1#![doc = "MAVLink matrixpilot dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20#[cfg(feature = "ts")]
21use ts_rs::TS;
22pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
23#[cfg_attr(feature = "ts", derive(TS))]
24#[cfg_attr(feature = "ts", ts(export))]
25#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
26#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27#[cfg_attr(feature = "serde", serde(tag = "type"))]
28#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29#[repr(u32)]
30#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
31pub enum ActuatorConfiguration {
32 #[doc = "Do nothing."]
33 ACTUATOR_CONFIGURATION_NONE = 0,
34 #[doc = "Command the actuator to beep now."]
35 ACTUATOR_CONFIGURATION_BEEP = 1,
36 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
37 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
38 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
39 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
40 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
41 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
42 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
43 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
44}
45impl ActuatorConfiguration {
46 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
47}
48impl Default for ActuatorConfiguration {
49 fn default() -> Self {
50 Self::DEFAULT
51 }
52}
53#[cfg_attr(feature = "ts", derive(TS))]
54#[cfg_attr(feature = "ts", ts(export))]
55#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
56#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
57#[cfg_attr(feature = "serde", serde(tag = "type"))]
58#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
59#[repr(u32)]
60#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
61pub enum ActuatorOutputFunction {
62 #[doc = "No function (disabled)."]
63 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
64 #[doc = "Motor 1"]
65 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
66 #[doc = "Motor 2"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
68 #[doc = "Motor 3"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
70 #[doc = "Motor 4"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
72 #[doc = "Motor 5"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
74 #[doc = "Motor 6"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
76 #[doc = "Motor 7"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
78 #[doc = "Motor 8"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
80 #[doc = "Motor 9"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
82 #[doc = "Motor 10"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
84 #[doc = "Motor 11"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
86 #[doc = "Motor 12"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
88 #[doc = "Motor 13"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
90 #[doc = "Motor 14"]
91 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
92 #[doc = "Motor 15"]
93 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
94 #[doc = "Motor 16"]
95 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
96 #[doc = "Servo 1"]
97 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
98 #[doc = "Servo 2"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
100 #[doc = "Servo 3"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
102 #[doc = "Servo 4"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
104 #[doc = "Servo 5"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
106 #[doc = "Servo 6"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
108 #[doc = "Servo 7"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
110 #[doc = "Servo 8"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
112 #[doc = "Servo 9"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
114 #[doc = "Servo 10"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
116 #[doc = "Servo 11"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
118 #[doc = "Servo 12"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
120 #[doc = "Servo 13"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
122 #[doc = "Servo 14"]
123 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
124 #[doc = "Servo 15"]
125 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
126 #[doc = "Servo 16"]
127 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
128}
129impl ActuatorOutputFunction {
130 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
131}
132impl Default for ActuatorOutputFunction {
133 fn default() -> Self {
134 Self::DEFAULT
135 }
136}
137#[cfg_attr(feature = "ts", derive(TS))]
138#[cfg_attr(feature = "ts", ts(export))]
139#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
140#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
141#[cfg_attr(feature = "serde", serde(tag = "type"))]
142#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
143#[repr(u32)]
144#[doc = "Enumeration of the ADSB altimeter types"]
145pub enum AdsbAltitudeType {
146 #[doc = "Altitude reported from a Baro source using QNH reference"]
147 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
148 #[doc = "Altitude reported from a GNSS source"]
149 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
150}
151impl AdsbAltitudeType {
152 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
153}
154impl Default for AdsbAltitudeType {
155 fn default() -> Self {
156 Self::DEFAULT
157 }
158}
159#[cfg_attr(feature = "ts", derive(TS))]
160#[cfg_attr(feature = "ts", ts(export))]
161#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
163#[cfg_attr(feature = "serde", serde(tag = "type"))]
164#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
165#[repr(u32)]
166#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
167pub enum AdsbEmitterType {
168 ADSB_EMITTER_TYPE_NO_INFO = 0,
169 ADSB_EMITTER_TYPE_LIGHT = 1,
170 ADSB_EMITTER_TYPE_SMALL = 2,
171 ADSB_EMITTER_TYPE_LARGE = 3,
172 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
173 ADSB_EMITTER_TYPE_HEAVY = 5,
174 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
175 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
176 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
177 ADSB_EMITTER_TYPE_GLIDER = 9,
178 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
179 ADSB_EMITTER_TYPE_PARACHUTE = 11,
180 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
181 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
182 ADSB_EMITTER_TYPE_UAV = 14,
183 ADSB_EMITTER_TYPE_SPACE = 15,
184 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
185 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
186 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
187 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
188}
189impl AdsbEmitterType {
190 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
191}
192impl Default for AdsbEmitterType {
193 fn default() -> Self {
194 Self::DEFAULT
195 }
196}
197bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
198impl AdsbFlags {
199 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
200}
201impl Default for AdsbFlags {
202 fn default() -> Self {
203 Self::DEFAULT
204 }
205}
206bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
207impl AisFlags {
208 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
209}
210impl Default for AisFlags {
211 fn default() -> Self {
212 Self::DEFAULT
213 }
214}
215#[cfg_attr(feature = "ts", derive(TS))]
216#[cfg_attr(feature = "ts", ts(export))]
217#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
219#[cfg_attr(feature = "serde", serde(tag = "type"))]
220#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
221#[repr(u32)]
222#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
223pub enum AisNavStatus {
224 #[doc = "Under way using engine."]
225 UNDER_WAY = 0,
226 AIS_NAV_ANCHORED = 1,
227 AIS_NAV_UN_COMMANDED = 2,
228 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
229 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
230 AIS_NAV_MOORED = 5,
231 AIS_NAV_AGROUND = 6,
232 AIS_NAV_FISHING = 7,
233 AIS_NAV_SAILING = 8,
234 AIS_NAV_RESERVED_HSC = 9,
235 AIS_NAV_RESERVED_WIG = 10,
236 AIS_NAV_RESERVED_1 = 11,
237 AIS_NAV_RESERVED_2 = 12,
238 AIS_NAV_RESERVED_3 = 13,
239 #[doc = "Search And Rescue Transponder."]
240 AIS_NAV_AIS_SART = 14,
241 #[doc = "Not available (default)."]
242 AIS_NAV_UNKNOWN = 15,
243}
244impl AisNavStatus {
245 pub const DEFAULT: Self = Self::UNDER_WAY;
246}
247impl Default for AisNavStatus {
248 fn default() -> Self {
249 Self::DEFAULT
250 }
251}
252#[cfg_attr(feature = "ts", derive(TS))]
253#[cfg_attr(feature = "ts", ts(export))]
254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
256#[cfg_attr(feature = "serde", serde(tag = "type"))]
257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
258#[repr(u32)]
259#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
260pub enum AisType {
261 #[doc = "Not available (default)."]
262 AIS_TYPE_UNKNOWN = 0,
263 AIS_TYPE_RESERVED_1 = 1,
264 AIS_TYPE_RESERVED_2 = 2,
265 AIS_TYPE_RESERVED_3 = 3,
266 AIS_TYPE_RESERVED_4 = 4,
267 AIS_TYPE_RESERVED_5 = 5,
268 AIS_TYPE_RESERVED_6 = 6,
269 AIS_TYPE_RESERVED_7 = 7,
270 AIS_TYPE_RESERVED_8 = 8,
271 AIS_TYPE_RESERVED_9 = 9,
272 AIS_TYPE_RESERVED_10 = 10,
273 AIS_TYPE_RESERVED_11 = 11,
274 AIS_TYPE_RESERVED_12 = 12,
275 AIS_TYPE_RESERVED_13 = 13,
276 AIS_TYPE_RESERVED_14 = 14,
277 AIS_TYPE_RESERVED_15 = 15,
278 AIS_TYPE_RESERVED_16 = 16,
279 AIS_TYPE_RESERVED_17 = 17,
280 AIS_TYPE_RESERVED_18 = 18,
281 AIS_TYPE_RESERVED_19 = 19,
282 #[doc = "Wing In Ground effect."]
283 AIS_TYPE_WIG = 20,
284 AIS_TYPE_WIG_HAZARDOUS_A = 21,
285 AIS_TYPE_WIG_HAZARDOUS_B = 22,
286 AIS_TYPE_WIG_HAZARDOUS_C = 23,
287 AIS_TYPE_WIG_HAZARDOUS_D = 24,
288 AIS_TYPE_WIG_RESERVED_1 = 25,
289 AIS_TYPE_WIG_RESERVED_2 = 26,
290 AIS_TYPE_WIG_RESERVED_3 = 27,
291 AIS_TYPE_WIG_RESERVED_4 = 28,
292 AIS_TYPE_WIG_RESERVED_5 = 29,
293 AIS_TYPE_FISHING = 30,
294 AIS_TYPE_TOWING = 31,
295 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
296 AIS_TYPE_TOWING_LARGE = 32,
297 #[doc = "Dredging or other underwater ops."]
298 AIS_TYPE_DREDGING = 33,
299 AIS_TYPE_DIVING = 34,
300 AIS_TYPE_MILITARY = 35,
301 AIS_TYPE_SAILING = 36,
302 AIS_TYPE_PLEASURE = 37,
303 AIS_TYPE_RESERVED_20 = 38,
304 AIS_TYPE_RESERVED_21 = 39,
305 #[doc = "High Speed Craft."]
306 AIS_TYPE_HSC = 40,
307 AIS_TYPE_HSC_HAZARDOUS_A = 41,
308 AIS_TYPE_HSC_HAZARDOUS_B = 42,
309 AIS_TYPE_HSC_HAZARDOUS_C = 43,
310 AIS_TYPE_HSC_HAZARDOUS_D = 44,
311 AIS_TYPE_HSC_RESERVED_1 = 45,
312 AIS_TYPE_HSC_RESERVED_2 = 46,
313 AIS_TYPE_HSC_RESERVED_3 = 47,
314 AIS_TYPE_HSC_RESERVED_4 = 48,
315 AIS_TYPE_HSC_UNKNOWN = 49,
316 AIS_TYPE_PILOT = 50,
317 #[doc = "Search And Rescue vessel."]
318 AIS_TYPE_SAR = 51,
319 AIS_TYPE_TUG = 52,
320 AIS_TYPE_PORT_TENDER = 53,
321 #[doc = "Anti-pollution equipment."]
322 AIS_TYPE_ANTI_POLLUTION = 54,
323 AIS_TYPE_LAW_ENFORCEMENT = 55,
324 AIS_TYPE_SPARE_LOCAL_1 = 56,
325 AIS_TYPE_SPARE_LOCAL_2 = 57,
326 AIS_TYPE_MEDICAL_TRANSPORT = 58,
327 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
328 AIS_TYPE_NONECOMBATANT = 59,
329 AIS_TYPE_PASSENGER = 60,
330 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
331 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
332 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
333 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
334 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
335 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
336 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
337 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
338 AIS_TYPE_PASSENGER_UNKNOWN = 69,
339 AIS_TYPE_CARGO = 70,
340 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
341 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
342 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
343 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
344 AIS_TYPE_CARGO_RESERVED_1 = 75,
345 AIS_TYPE_CARGO_RESERVED_2 = 76,
346 AIS_TYPE_CARGO_RESERVED_3 = 77,
347 AIS_TYPE_CARGO_RESERVED_4 = 78,
348 AIS_TYPE_CARGO_UNKNOWN = 79,
349 AIS_TYPE_TANKER = 80,
350 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
351 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
352 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
353 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
354 AIS_TYPE_TANKER_RESERVED_1 = 85,
355 AIS_TYPE_TANKER_RESERVED_2 = 86,
356 AIS_TYPE_TANKER_RESERVED_3 = 87,
357 AIS_TYPE_TANKER_RESERVED_4 = 88,
358 AIS_TYPE_TANKER_UNKNOWN = 89,
359 AIS_TYPE_OTHER = 90,
360 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
361 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
362 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
363 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
364 AIS_TYPE_OTHER_RESERVED_1 = 95,
365 AIS_TYPE_OTHER_RESERVED_2 = 96,
366 AIS_TYPE_OTHER_RESERVED_3 = 97,
367 AIS_TYPE_OTHER_RESERVED_4 = 98,
368 AIS_TYPE_OTHER_UNKNOWN = 99,
369}
370impl AisType {
371 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
372}
373impl Default for AisType {
374 fn default() -> Self {
375 Self::DEFAULT
376 }
377}
378bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
379impl AttitudeTargetTypemask {
380 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
381}
382impl Default for AttitudeTargetTypemask {
383 fn default() -> Self {
384 Self::DEFAULT
385 }
386}
387#[cfg_attr(feature = "ts", derive(TS))]
388#[cfg_attr(feature = "ts", ts(export))]
389#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
390#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
391#[cfg_attr(feature = "serde", serde(tag = "type"))]
392#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
393#[repr(u32)]
394#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
395pub enum AutotuneAxis {
396 #[doc = "Autotune roll axis."]
397 AUTOTUNE_AXIS_ROLL = 1,
398 #[doc = "Autotune pitch axis."]
399 AUTOTUNE_AXIS_PITCH = 2,
400 #[doc = "Autotune yaw axis."]
401 AUTOTUNE_AXIS_YAW = 4,
402}
403impl AutotuneAxis {
404 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
405}
406impl Default for AutotuneAxis {
407 fn default() -> Self {
408 Self::DEFAULT
409 }
410}
411bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
412impl CameraCapFlags {
413 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
414}
415impl Default for CameraCapFlags {
416 fn default() -> Self {
417 Self::DEFAULT
418 }
419}
420#[cfg_attr(feature = "ts", derive(TS))]
421#[cfg_attr(feature = "ts", ts(export))]
422#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
423#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
424#[cfg_attr(feature = "serde", serde(tag = "type"))]
425#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
426#[repr(u32)]
427#[doc = "Camera Modes."]
428pub enum CameraMode {
429 #[doc = "Camera is in image/photo capture mode."]
430 CAMERA_MODE_IMAGE = 0,
431 #[doc = "Camera is in video capture mode."]
432 CAMERA_MODE_VIDEO = 1,
433 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
434 CAMERA_MODE_IMAGE_SURVEY = 2,
435}
436impl CameraMode {
437 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
438}
439impl Default for CameraMode {
440 fn default() -> Self {
441 Self::DEFAULT
442 }
443}
444#[cfg_attr(feature = "ts", derive(TS))]
445#[cfg_attr(feature = "ts", ts(export))]
446#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
448#[cfg_attr(feature = "serde", serde(tag = "type"))]
449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
450#[repr(u32)]
451#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
452pub enum CameraSource {
453 #[doc = "Default camera source."]
454 CAMERA_SOURCE_DEFAULT = 0,
455 #[doc = "RGB camera source."]
456 CAMERA_SOURCE_RGB = 1,
457 #[doc = "IR camera source."]
458 CAMERA_SOURCE_IR = 2,
459 #[doc = "NDVI camera source."]
460 CAMERA_SOURCE_NDVI = 3,
461}
462impl CameraSource {
463 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
464}
465impl Default for CameraSource {
466 fn default() -> Self {
467 Self::DEFAULT
468 }
469}
470#[cfg_attr(feature = "ts", derive(TS))]
471#[cfg_attr(feature = "ts", ts(export))]
472#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
474#[cfg_attr(feature = "serde", serde(tag = "type"))]
475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
476#[repr(u32)]
477#[doc = "Camera tracking modes"]
478pub enum CameraTrackingMode {
479 #[doc = "Not tracking"]
480 CAMERA_TRACKING_MODE_NONE = 0,
481 #[doc = "Target is a point"]
482 CAMERA_TRACKING_MODE_POINT = 1,
483 #[doc = "Target is a rectangle"]
484 CAMERA_TRACKING_MODE_RECTANGLE = 2,
485}
486impl CameraTrackingMode {
487 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
488}
489impl Default for CameraTrackingMode {
490 fn default() -> Self {
491 Self::DEFAULT
492 }
493}
494#[cfg_attr(feature = "ts", derive(TS))]
495#[cfg_attr(feature = "ts", ts(export))]
496#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
498#[cfg_attr(feature = "serde", serde(tag = "type"))]
499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
500#[repr(u32)]
501#[doc = "Camera tracking status flags"]
502pub enum CameraTrackingStatusFlags {
503 #[doc = "Camera is not tracking"]
504 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
505 #[doc = "Camera is tracking"]
506 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
507 #[doc = "Camera tracking in error state"]
508 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
509}
510impl CameraTrackingStatusFlags {
511 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
512}
513impl Default for CameraTrackingStatusFlags {
514 fn default() -> Self {
515 Self::DEFAULT
516 }
517}
518bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
519impl CameraTrackingTargetData {
520 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
521}
522impl Default for CameraTrackingTargetData {
523 fn default() -> Self {
524 Self::DEFAULT
525 }
526}
527#[cfg_attr(feature = "ts", derive(TS))]
528#[cfg_attr(feature = "ts", ts(export))]
529#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
531#[cfg_attr(feature = "serde", serde(tag = "type"))]
532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
533#[repr(u32)]
534#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
535pub enum CameraZoomType {
536 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
537 ZOOM_TYPE_STEP = 0,
538 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
539 ZOOM_TYPE_CONTINUOUS = 1,
540 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
541 ZOOM_TYPE_RANGE = 2,
542 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
543 ZOOM_TYPE_FOCAL_LENGTH = 3,
544 #[doc = "Zoom value as horizontal field of view in degrees."]
545 ZOOM_TYPE_HORIZONTAL_FOV = 4,
546}
547impl CameraZoomType {
548 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
549}
550impl Default for CameraZoomType {
551 fn default() -> Self {
552 Self::DEFAULT
553 }
554}
555#[cfg_attr(feature = "ts", derive(TS))]
556#[cfg_attr(feature = "ts", ts(export))]
557#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
558#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
559#[cfg_attr(feature = "serde", serde(tag = "type"))]
560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
561#[repr(u32)]
562pub enum CanFilterOp {
563 CAN_FILTER_REPLACE = 0,
564 CAN_FILTER_ADD = 1,
565 CAN_FILTER_REMOVE = 2,
566}
567impl CanFilterOp {
568 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
569}
570impl Default for CanFilterOp {
571 fn default() -> Self {
572 Self::DEFAULT
573 }
574}
575#[cfg_attr(feature = "ts", derive(TS))]
576#[cfg_attr(feature = "ts", ts(export))]
577#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
579#[cfg_attr(feature = "serde", serde(tag = "type"))]
580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
581#[repr(u32)]
582#[doc = "Possible responses from a CELLULAR_CONFIG message."]
583pub enum CellularConfigResponse {
584 #[doc = "Changes accepted."]
585 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
586 #[doc = "Invalid APN."]
587 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
588 #[doc = "Invalid PIN."]
589 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
590 #[doc = "Changes rejected."]
591 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
592 #[doc = "PUK is required to unblock SIM card."]
593 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
594}
595impl CellularConfigResponse {
596 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
597}
598impl Default for CellularConfigResponse {
599 fn default() -> Self {
600 Self::DEFAULT
601 }
602}
603#[cfg_attr(feature = "ts", derive(TS))]
604#[cfg_attr(feature = "ts", ts(export))]
605#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
607#[cfg_attr(feature = "serde", serde(tag = "type"))]
608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
609#[repr(u32)]
610#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
611pub enum CellularNetworkFailedReason {
612 #[doc = "No error"]
613 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
614 #[doc = "Error state is unknown"]
615 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
616 #[doc = "SIM is required for the modem but missing"]
617 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
618 #[doc = "SIM is available, but not usable for connection"]
619 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
620}
621impl CellularNetworkFailedReason {
622 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
623}
624impl Default for CellularNetworkFailedReason {
625 fn default() -> Self {
626 Self::DEFAULT
627 }
628}
629#[cfg_attr(feature = "ts", derive(TS))]
630#[cfg_attr(feature = "ts", ts(export))]
631#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
632#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
633#[cfg_attr(feature = "serde", serde(tag = "type"))]
634#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
635#[repr(u32)]
636#[doc = "Cellular network radio type"]
637pub enum CellularNetworkRadioType {
638 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
639 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
640 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
641 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
642 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
643}
644impl CellularNetworkRadioType {
645 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
646}
647impl Default for CellularNetworkRadioType {
648 fn default() -> Self {
649 Self::DEFAULT
650 }
651}
652#[cfg_attr(feature = "ts", derive(TS))]
653#[cfg_attr(feature = "ts", ts(export))]
654#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
656#[cfg_attr(feature = "serde", serde(tag = "type"))]
657#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
658#[repr(u32)]
659#[doc = "These flags encode the cellular network status"]
660pub enum CellularStatusFlag {
661 #[doc = "State unknown or not reportable."]
662 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
663 #[doc = "Modem is unusable"]
664 CELLULAR_STATUS_FLAG_FAILED = 1,
665 #[doc = "Modem is being initialized"]
666 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
667 #[doc = "Modem is locked"]
668 CELLULAR_STATUS_FLAG_LOCKED = 3,
669 #[doc = "Modem is not enabled and is powered down"]
670 CELLULAR_STATUS_FLAG_DISABLED = 4,
671 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
672 CELLULAR_STATUS_FLAG_DISABLING = 5,
673 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
674 CELLULAR_STATUS_FLAG_ENABLING = 6,
675 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
676 CELLULAR_STATUS_FLAG_ENABLED = 7,
677 #[doc = "Modem is searching for a network provider to register"]
678 CELLULAR_STATUS_FLAG_SEARCHING = 8,
679 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
680 CELLULAR_STATUS_FLAG_REGISTERED = 9,
681 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
682 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
683 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
684 CELLULAR_STATUS_FLAG_CONNECTING = 11,
685 #[doc = "One or more packet data bearers is active and connected"]
686 CELLULAR_STATUS_FLAG_CONNECTED = 12,
687}
688impl CellularStatusFlag {
689 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
690}
691impl Default for CellularStatusFlag {
692 fn default() -> Self {
693 Self::DEFAULT
694 }
695}
696#[cfg_attr(feature = "ts", derive(TS))]
697#[cfg_attr(feature = "ts", ts(export))]
698#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
699#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
700#[cfg_attr(feature = "serde", serde(tag = "type"))]
701#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
702#[repr(u32)]
703#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
704pub enum CompMetadataType {
705 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
706 COMP_METADATA_TYPE_GENERAL = 0,
707 #[doc = "Parameter meta data."]
708 COMP_METADATA_TYPE_PARAMETER = 1,
709 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
710 COMP_METADATA_TYPE_COMMANDS = 2,
711 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
712 COMP_METADATA_TYPE_PERIPHERALS = 3,
713 #[doc = "Meta data for the events interface."]
714 COMP_METADATA_TYPE_EVENTS = 4,
715 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
716 COMP_METADATA_TYPE_ACTUATORS = 5,
717}
718impl CompMetadataType {
719 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
720}
721impl Default for CompMetadataType {
722 fn default() -> Self {
723 Self::DEFAULT
724 }
725}
726#[cfg_attr(feature = "ts", derive(TS))]
727#[cfg_attr(feature = "ts", ts(export))]
728#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
730#[cfg_attr(feature = "serde", serde(tag = "type"))]
731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
732#[repr(u32)]
733#[doc = "Indicates the ESC connection type."]
734pub enum EscConnectionType {
735 #[doc = "Traditional PPM ESC."]
736 ESC_CONNECTION_TYPE_PPM = 0,
737 #[doc = "Serial Bus connected ESC."]
738 ESC_CONNECTION_TYPE_SERIAL = 1,
739 #[doc = "One Shot PPM ESC."]
740 ESC_CONNECTION_TYPE_ONESHOT = 2,
741 #[doc = "I2C ESC."]
742 ESC_CONNECTION_TYPE_I2C = 3,
743 #[doc = "CAN-Bus ESC."]
744 ESC_CONNECTION_TYPE_CAN = 4,
745 #[doc = "DShot ESC."]
746 ESC_CONNECTION_TYPE_DSHOT = 5,
747}
748impl EscConnectionType {
749 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
750}
751impl Default for EscConnectionType {
752 fn default() -> Self {
753 Self::DEFAULT
754 }
755}
756bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
757impl EscFailureFlags {
758 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
759}
760impl Default for EscFailureFlags {
761 fn default() -> Self {
762 Self::DEFAULT
763 }
764}
765bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
766impl EstimatorStatusFlags {
767 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
768}
769impl Default for EstimatorStatusFlags {
770 fn default() -> Self {
771 Self::DEFAULT
772 }
773}
774#[cfg_attr(feature = "ts", derive(TS))]
775#[cfg_attr(feature = "ts", ts(export))]
776#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
777#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
778#[cfg_attr(feature = "serde", serde(tag = "type"))]
779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
780#[repr(u32)]
781#[doc = "List of possible failure type to inject."]
782pub enum FailureType {
783 #[doc = "No failure injected, used to reset a previous failure."]
784 FAILURE_TYPE_OK = 0,
785 #[doc = "Sets unit off, so completely non-responsive."]
786 FAILURE_TYPE_OFF = 1,
787 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
788 FAILURE_TYPE_STUCK = 2,
789 #[doc = "Unit is reporting complete garbage."]
790 FAILURE_TYPE_GARBAGE = 3,
791 #[doc = "Unit is consistently wrong."]
792 FAILURE_TYPE_WRONG = 4,
793 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
794 FAILURE_TYPE_SLOW = 5,
795 #[doc = "Data of unit is delayed in time."]
796 FAILURE_TYPE_DELAYED = 6,
797 #[doc = "Unit is sometimes working, sometimes not."]
798 FAILURE_TYPE_INTERMITTENT = 7,
799}
800impl FailureType {
801 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
802}
803impl Default for FailureType {
804 fn default() -> Self {
805 Self::DEFAULT
806 }
807}
808#[cfg_attr(feature = "ts", derive(TS))]
809#[cfg_attr(feature = "ts", ts(export))]
810#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
812#[cfg_attr(feature = "serde", serde(tag = "type"))]
813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
814#[repr(u32)]
815#[doc = "List of possible units where failures can be injected."]
816pub enum FailureUnit {
817 FAILURE_UNIT_SENSOR_GYRO = 0,
818 FAILURE_UNIT_SENSOR_ACCEL = 1,
819 FAILURE_UNIT_SENSOR_MAG = 2,
820 FAILURE_UNIT_SENSOR_BARO = 3,
821 FAILURE_UNIT_SENSOR_GPS = 4,
822 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
823 FAILURE_UNIT_SENSOR_VIO = 6,
824 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
825 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
826 FAILURE_UNIT_SYSTEM_BATTERY = 100,
827 FAILURE_UNIT_SYSTEM_MOTOR = 101,
828 FAILURE_UNIT_SYSTEM_SERVO = 102,
829 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
830 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
831 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
832}
833impl FailureUnit {
834 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
835}
836impl Default for FailureUnit {
837 fn default() -> Self {
838 Self::DEFAULT
839 }
840}
841#[cfg_attr(feature = "ts", derive(TS))]
842#[cfg_attr(feature = "ts", ts(export))]
843#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
845#[cfg_attr(feature = "serde", serde(tag = "type"))]
846#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
847#[repr(u32)]
848pub enum FenceBreach {
849 #[doc = "No last fence breach"]
850 FENCE_BREACH_NONE = 0,
851 #[doc = "Breached minimum altitude"]
852 FENCE_BREACH_MINALT = 1,
853 #[doc = "Breached maximum altitude"]
854 FENCE_BREACH_MAXALT = 2,
855 #[doc = "Breached fence boundary"]
856 FENCE_BREACH_BOUNDARY = 3,
857}
858impl FenceBreach {
859 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
860}
861impl Default for FenceBreach {
862 fn default() -> Self {
863 Self::DEFAULT
864 }
865}
866#[cfg_attr(feature = "ts", derive(TS))]
867#[cfg_attr(feature = "ts", ts(export))]
868#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
870#[cfg_attr(feature = "serde", serde(tag = "type"))]
871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
872#[repr(u32)]
873#[doc = "Actions being taken to mitigate/prevent fence breach"]
874pub enum FenceMitigate {
875 #[doc = "Unknown"]
876 FENCE_MITIGATE_UNKNOWN = 0,
877 #[doc = "No actions being taken"]
878 FENCE_MITIGATE_NONE = 1,
879 #[doc = "Velocity limiting active to prevent breach"]
880 FENCE_MITIGATE_VEL_LIMIT = 2,
881}
882impl FenceMitigate {
883 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
884}
885impl Default for FenceMitigate {
886 fn default() -> Self {
887 Self::DEFAULT
888 }
889}
890#[cfg_attr(feature = "ts", derive(TS))]
891#[cfg_attr(feature = "ts", ts(export))]
892#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
894#[cfg_attr(feature = "serde", serde(tag = "type"))]
895#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
896#[repr(u32)]
897#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
898pub enum FenceType {
899 #[doc = "Maximum altitude fence"]
900 FENCE_TYPE_ALT_MAX = 1,
901 #[doc = "Circle fence"]
902 FENCE_TYPE_CIRCLE = 2,
903 #[doc = "Polygon fence"]
904 FENCE_TYPE_POLYGON = 4,
905 #[doc = "Minimum altitude fence"]
906 FENCE_TYPE_ALT_MIN = 8,
907}
908impl FenceType {
909 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
910}
911impl Default for FenceType {
912 fn default() -> Self {
913 Self::DEFAULT
914 }
915}
916#[cfg_attr(feature = "ts", derive(TS))]
917#[cfg_attr(feature = "ts", ts(export))]
918#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
920#[cfg_attr(feature = "serde", serde(tag = "type"))]
921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
922#[repr(u32)]
923#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
924pub enum FirmwareVersionType {
925 #[doc = "development release"]
926 FIRMWARE_VERSION_TYPE_DEV = 0,
927 #[doc = "alpha release"]
928 FIRMWARE_VERSION_TYPE_ALPHA = 64,
929 #[doc = "beta release"]
930 FIRMWARE_VERSION_TYPE_BETA = 128,
931 #[doc = "release candidate"]
932 FIRMWARE_VERSION_TYPE_RC = 192,
933 #[doc = "official stable release"]
934 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
935}
936impl FirmwareVersionType {
937 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
938}
939impl Default for FirmwareVersionType {
940 fn default() -> Self {
941 Self::DEFAULT
942 }
943}
944bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
945impl GimbalDeviceCapFlags {
946 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
947}
948impl Default for GimbalDeviceCapFlags {
949 fn default() -> Self {
950 Self::DEFAULT
951 }
952}
953bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
954impl GimbalDeviceErrorFlags {
955 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
956}
957impl Default for GimbalDeviceErrorFlags {
958 fn default() -> Self {
959 Self::DEFAULT
960 }
961}
962bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
963impl GimbalDeviceFlags {
964 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
965}
966impl Default for GimbalDeviceFlags {
967 fn default() -> Self {
968 Self::DEFAULT
969 }
970}
971bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
972impl GimbalManagerCapFlags {
973 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
974}
975impl Default for GimbalManagerCapFlags {
976 fn default() -> Self {
977 Self::DEFAULT
978 }
979}
980bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
981impl GimbalManagerFlags {
982 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
983}
984impl Default for GimbalManagerFlags {
985 fn default() -> Self {
986 Self::DEFAULT
987 }
988}
989#[cfg_attr(feature = "ts", derive(TS))]
990#[cfg_attr(feature = "ts", ts(export))]
991#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
993#[cfg_attr(feature = "serde", serde(tag = "type"))]
994#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
995#[repr(u32)]
996#[doc = "Type of GPS fix"]
997pub enum GpsFixType {
998 #[doc = "No GPS connected"]
999 GPS_FIX_TYPE_NO_GPS = 0,
1000 #[doc = "No position information, GPS is connected"]
1001 GPS_FIX_TYPE_NO_FIX = 1,
1002 #[doc = "2D position"]
1003 GPS_FIX_TYPE_2D_FIX = 2,
1004 #[doc = "3D position"]
1005 GPS_FIX_TYPE_3D_FIX = 3,
1006 #[doc = "DGPS/SBAS aided 3D position"]
1007 GPS_FIX_TYPE_DGPS = 4,
1008 #[doc = "RTK float, 3D position"]
1009 GPS_FIX_TYPE_RTK_FLOAT = 5,
1010 #[doc = "RTK Fixed, 3D position"]
1011 GPS_FIX_TYPE_RTK_FIXED = 6,
1012 #[doc = "Static fixed, typically used for base stations"]
1013 GPS_FIX_TYPE_STATIC = 7,
1014 #[doc = "PPP, 3D position."]
1015 GPS_FIX_TYPE_PPP = 8,
1016}
1017impl GpsFixType {
1018 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1019}
1020impl Default for GpsFixType {
1021 fn default() -> Self {
1022 Self::DEFAULT
1023 }
1024}
1025bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1026impl GpsInputIgnoreFlags {
1027 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1028}
1029impl Default for GpsInputIgnoreFlags {
1030 fn default() -> Self {
1031 Self::DEFAULT
1032 }
1033}
1034#[cfg_attr(feature = "ts", derive(TS))]
1035#[cfg_attr(feature = "ts", ts(export))]
1036#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1037#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1038#[cfg_attr(feature = "serde", serde(tag = "type"))]
1039#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1040#[repr(u32)]
1041#[doc = "Gripper actions."]
1042pub enum GripperActions {
1043 #[doc = "Gripper release cargo."]
1044 GRIPPER_ACTION_RELEASE = 0,
1045 #[doc = "Gripper grab onto cargo."]
1046 GRIPPER_ACTION_GRAB = 1,
1047}
1048impl GripperActions {
1049 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1050}
1051impl Default for GripperActions {
1052 fn default() -> Self {
1053 Self::DEFAULT
1054 }
1055}
1056bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1057impl HighresImuUpdatedFlags {
1058 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1059}
1060impl Default for HighresImuUpdatedFlags {
1061 fn default() -> Self {
1062 Self::DEFAULT
1063 }
1064}
1065bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1066impl HilActuatorControlsFlags {
1067 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1068}
1069impl Default for HilActuatorControlsFlags {
1070 fn default() -> Self {
1071 Self::DEFAULT
1072 }
1073}
1074bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1075impl HilSensorUpdatedFlags {
1076 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1077}
1078impl Default for HilSensorUpdatedFlags {
1079 fn default() -> Self {
1080 Self::DEFAULT
1081 }
1082}
1083bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1084impl HlFailureFlag {
1085 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1086}
1087impl Default for HlFailureFlag {
1088 fn default() -> Self {
1089 Self::DEFAULT
1090 }
1091}
1092bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1093impl IlluminatorErrorFlags {
1094 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1095}
1096impl Default for IlluminatorErrorFlags {
1097 fn default() -> Self {
1098 Self::DEFAULT
1099 }
1100}
1101#[cfg_attr(feature = "ts", derive(TS))]
1102#[cfg_attr(feature = "ts", ts(export))]
1103#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1105#[cfg_attr(feature = "serde", serde(tag = "type"))]
1106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1107#[repr(u32)]
1108#[doc = "Modes of illuminator"]
1109pub enum IlluminatorMode {
1110 #[doc = "Illuminator mode is not specified/unknown"]
1111 ILLUMINATOR_MODE_UNKNOWN = 0,
1112 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1113 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1114 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1115 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1116}
1117impl IlluminatorMode {
1118 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1119}
1120impl Default for IlluminatorMode {
1121 fn default() -> Self {
1122 Self::DEFAULT
1123 }
1124}
1125#[cfg_attr(feature = "ts", derive(TS))]
1126#[cfg_attr(feature = "ts", ts(export))]
1127#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1129#[cfg_attr(feature = "serde", serde(tag = "type"))]
1130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1131#[repr(u32)]
1132#[doc = "Type of landing target"]
1133pub enum LandingTargetType {
1134 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1135 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1136 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1137 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1138 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1139 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1140 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1141 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1142}
1143impl LandingTargetType {
1144 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1145}
1146impl Default for LandingTargetType {
1147 fn default() -> Self {
1148 Self::DEFAULT
1149 }
1150}
1151#[cfg_attr(feature = "ts", derive(TS))]
1152#[cfg_attr(feature = "ts", ts(export))]
1153#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1155#[cfg_attr(feature = "serde", serde(tag = "type"))]
1156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1157#[repr(u32)]
1158pub enum MagCalStatus {
1159 MAG_CAL_NOT_STARTED = 0,
1160 MAG_CAL_WAITING_TO_START = 1,
1161 MAG_CAL_RUNNING_STEP_ONE = 2,
1162 MAG_CAL_RUNNING_STEP_TWO = 3,
1163 MAG_CAL_SUCCESS = 4,
1164 MAG_CAL_FAILED = 5,
1165 MAG_CAL_BAD_ORIENTATION = 6,
1166 MAG_CAL_BAD_RADIUS = 7,
1167}
1168impl MagCalStatus {
1169 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1170}
1171impl Default for MagCalStatus {
1172 fn default() -> Self {
1173 Self::DEFAULT
1174 }
1175}
1176#[cfg_attr(feature = "ts", derive(TS))]
1177#[cfg_attr(feature = "ts", ts(export))]
1178#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1179#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1180#[cfg_attr(feature = "serde", serde(tag = "type"))]
1181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1182#[repr(u32)]
1183pub enum MavArmAuthDeniedReason {
1184 #[doc = "Not a specific reason"]
1185 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1186 #[doc = "Authorizer will send the error as string to GCS"]
1187 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1188 #[doc = "At least one waypoint have a invalid value"]
1189 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1190 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1191 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1192 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1193 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1194 #[doc = "Weather is not good to fly"]
1195 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1196}
1197impl MavArmAuthDeniedReason {
1198 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1199}
1200impl Default for MavArmAuthDeniedReason {
1201 fn default() -> Self {
1202 Self::DEFAULT
1203 }
1204}
1205#[cfg_attr(feature = "ts", derive(TS))]
1206#[cfg_attr(feature = "ts", ts(export))]
1207#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1209#[cfg_attr(feature = "serde", serde(tag = "type"))]
1210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1211#[repr(u32)]
1212#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1213pub enum MavAutopilot {
1214 #[doc = "Generic autopilot, full support for everything"]
1215 MAV_AUTOPILOT_GENERIC = 0,
1216 #[doc = "Reserved for future use."]
1217 MAV_AUTOPILOT_RESERVED = 1,
1218 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1219 MAV_AUTOPILOT_SLUGS = 2,
1220 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1221 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1222 #[doc = "OpenPilot, <http://openpilot.org>"]
1223 MAV_AUTOPILOT_OPENPILOT = 4,
1224 #[doc = "Generic autopilot only supporting simple waypoints"]
1225 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1226 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1227 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1228 #[doc = "Generic autopilot supporting the full mission command set"]
1229 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1230 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1231 MAV_AUTOPILOT_INVALID = 8,
1232 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1233 MAV_AUTOPILOT_PPZ = 9,
1234 #[doc = "UAV Dev Board"]
1235 MAV_AUTOPILOT_UDB = 10,
1236 #[doc = "FlexiPilot"]
1237 MAV_AUTOPILOT_FP = 11,
1238 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1239 MAV_AUTOPILOT_PX4 = 12,
1240 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1241 MAV_AUTOPILOT_SMACCMPILOT = 13,
1242 #[doc = "AutoQuad -- <http://autoquad.org>"]
1243 MAV_AUTOPILOT_AUTOQUAD = 14,
1244 #[doc = "Armazila -- <http://armazila.com>"]
1245 MAV_AUTOPILOT_ARMAZILA = 15,
1246 #[doc = "Aerob -- <http://aerob.ru>"]
1247 MAV_AUTOPILOT_AEROB = 16,
1248 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1249 MAV_AUTOPILOT_ASLUAV = 17,
1250 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1251 MAV_AUTOPILOT_SMARTAP = 18,
1252 #[doc = "AirRails - <http://uaventure.com>"]
1253 MAV_AUTOPILOT_AIRRAILS = 19,
1254 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1255 MAV_AUTOPILOT_REFLEX = 20,
1256}
1257impl MavAutopilot {
1258 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1259}
1260impl Default for MavAutopilot {
1261 fn default() -> Self {
1262 Self::DEFAULT
1263 }
1264}
1265#[cfg_attr(feature = "ts", derive(TS))]
1266#[cfg_attr(feature = "ts", ts(export))]
1267#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1269#[cfg_attr(feature = "serde", serde(tag = "type"))]
1270#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1271#[repr(u32)]
1272#[doc = "Enumeration for battery charge states."]
1273pub enum MavBatteryChargeState {
1274 #[doc = "Low battery state is not provided"]
1275 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1276 #[doc = "Battery is not in low state. Normal operation."]
1277 MAV_BATTERY_CHARGE_STATE_OK = 1,
1278 #[doc = "Battery state is low, warn and monitor close."]
1279 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1280 #[doc = "Battery state is critical, return or abort immediately."]
1281 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1282 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1283 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1284 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1285 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1286 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1287 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1288 #[doc = "Battery is charging."]
1289 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1290}
1291impl MavBatteryChargeState {
1292 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1293}
1294impl Default for MavBatteryChargeState {
1295 fn default() -> Self {
1296 Self::DEFAULT
1297 }
1298}
1299bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1300impl MavBatteryFault {
1301 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1302}
1303impl Default for MavBatteryFault {
1304 fn default() -> Self {
1305 Self::DEFAULT
1306 }
1307}
1308#[cfg_attr(feature = "ts", derive(TS))]
1309#[cfg_attr(feature = "ts", ts(export))]
1310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1312#[cfg_attr(feature = "serde", serde(tag = "type"))]
1313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1314#[repr(u32)]
1315#[doc = "Enumeration of battery functions"]
1316pub enum MavBatteryFunction {
1317 #[doc = "Battery function is unknown"]
1318 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1319 #[doc = "Battery supports all flight systems"]
1320 MAV_BATTERY_FUNCTION_ALL = 1,
1321 #[doc = "Battery for the propulsion system"]
1322 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1323 #[doc = "Avionics battery"]
1324 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1325 #[doc = "Payload battery"]
1326 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1327}
1328impl MavBatteryFunction {
1329 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1330}
1331impl Default for MavBatteryFunction {
1332 fn default() -> Self {
1333 Self::DEFAULT
1334 }
1335}
1336#[cfg_attr(feature = "ts", derive(TS))]
1337#[cfg_attr(feature = "ts", ts(export))]
1338#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1340#[cfg_attr(feature = "serde", serde(tag = "type"))]
1341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1342#[repr(u32)]
1343#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1344pub enum MavBatteryMode {
1345 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1346 MAV_BATTERY_MODE_UNKNOWN = 0,
1347 #[doc = "Battery is auto discharging (towards storage level)."]
1348 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1349 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1350 MAV_BATTERY_MODE_HOT_SWAP = 2,
1351}
1352impl MavBatteryMode {
1353 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1354}
1355impl Default for MavBatteryMode {
1356 fn default() -> Self {
1357 Self::DEFAULT
1358 }
1359}
1360#[cfg_attr(feature = "ts", derive(TS))]
1361#[cfg_attr(feature = "ts", ts(export))]
1362#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1364#[cfg_attr(feature = "serde", serde(tag = "type"))]
1365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1366#[repr(u32)]
1367#[doc = "Enumeration of battery types"]
1368pub enum MavBatteryType {
1369 #[doc = "Not specified."]
1370 MAV_BATTERY_TYPE_UNKNOWN = 0,
1371 #[doc = "Lithium polymer battery"]
1372 MAV_BATTERY_TYPE_LIPO = 1,
1373 #[doc = "Lithium-iron-phosphate battery"]
1374 MAV_BATTERY_TYPE_LIFE = 2,
1375 #[doc = "Lithium-ION battery"]
1376 MAV_BATTERY_TYPE_LION = 3,
1377 #[doc = "Nickel metal hydride battery"]
1378 MAV_BATTERY_TYPE_NIMH = 4,
1379}
1380impl MavBatteryType {
1381 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1382}
1383impl Default for MavBatteryType {
1384 fn default() -> Self {
1385 Self::DEFAULT
1386 }
1387}
1388#[cfg_attr(feature = "ts", derive(TS))]
1389#[cfg_attr(feature = "ts", ts(export))]
1390#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1392#[cfg_attr(feature = "serde", serde(tag = "type"))]
1393#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1394#[repr(u32)]
1395#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1396pub enum MavCmd {
1397 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1398 MAV_CMD_NAV_WAYPOINT = 16,
1399 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1400 MAV_CMD_NAV_LOITER_UNLIM = 17,
1401 #[doc = "Loiter around this waypoint for X turns"]
1402 MAV_CMD_NAV_LOITER_TURNS = 18,
1403 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1404 MAV_CMD_NAV_LOITER_TIME = 19,
1405 #[doc = "Return to launch location"]
1406 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1407 #[doc = "Land at location."]
1408 MAV_CMD_NAV_LAND = 21,
1409 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1410 MAV_CMD_NAV_TAKEOFF = 22,
1411 #[doc = "Land at local position (local frame only)"]
1412 MAV_CMD_NAV_LAND_LOCAL = 23,
1413 #[doc = "Takeoff from local position (local frame only)"]
1414 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1415 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1416 MAV_CMD_NAV_FOLLOW = 25,
1417 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1418 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1419 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1420 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1421 #[doc = "Begin following a target"]
1422 MAV_CMD_DO_FOLLOW = 32,
1423 #[doc = "Reposition the MAV after a follow target command has been sent"]
1424 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1425 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1426 MAV_CMD_DO_ORBIT = 34,
1427 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1428 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1429 MAV_CMD_NAV_ROI = 80,
1430 #[doc = "Control autonomous path planning on the MAV."]
1431 MAV_CMD_NAV_PATHPLANNING = 81,
1432 #[doc = "Navigate to waypoint using a spline path."]
1433 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1434 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1435 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1436 #[doc = "Land using VTOL mode"]
1437 MAV_CMD_NAV_VTOL_LAND = 85,
1438 #[doc = "hand control over to an external controller"]
1439 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1440 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1441 MAV_CMD_NAV_DELAY = 93,
1442 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1443 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1444 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1445 MAV_CMD_NAV_LAST = 95,
1446 #[doc = "Delay mission state machine."]
1447 MAV_CMD_CONDITION_DELAY = 112,
1448 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1449 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1450 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1451 MAV_CMD_CONDITION_DISTANCE = 114,
1452 #[doc = "Reach a certain target angle."]
1453 MAV_CMD_CONDITION_YAW = 115,
1454 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1455 MAV_CMD_CONDITION_LAST = 159,
1456 #[doc = "Set system mode."]
1457 MAV_CMD_DO_SET_MODE = 176,
1458 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1459 MAV_CMD_DO_JUMP = 177,
1460 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1461 MAV_CMD_DO_CHANGE_SPEED = 178,
1462 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1463 MAV_CMD_DO_SET_HOME = 179,
1464 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1465 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1466 MAV_CMD_DO_SET_PARAMETER = 180,
1467 #[doc = "Set a relay to a condition."]
1468 MAV_CMD_DO_SET_RELAY = 181,
1469 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1470 MAV_CMD_DO_REPEAT_RELAY = 182,
1471 #[doc = "Set a servo to a desired PWM value."]
1472 MAV_CMD_DO_SET_SERVO = 183,
1473 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1474 MAV_CMD_DO_REPEAT_SERVO = 184,
1475 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1476 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1477 #[doc = "Change altitude set point."]
1478 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1479 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1480 MAV_CMD_DO_SET_ACTUATOR = 187,
1481 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1482 MAV_CMD_DO_RETURN_PATH_START = 188,
1483 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1484 MAV_CMD_DO_LAND_START = 189,
1485 #[doc = "Mission command to perform a landing from a rally point."]
1486 MAV_CMD_DO_RALLY_LAND = 190,
1487 #[doc = "Mission command to safely abort an autonomous landing."]
1488 MAV_CMD_DO_GO_AROUND = 191,
1489 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1490 MAV_CMD_DO_REPOSITION = 192,
1491 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1492 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1493 #[doc = "Set moving direction to forward or reverse."]
1494 MAV_CMD_DO_SET_REVERSE = 194,
1495 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1496 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1497 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1498 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1499 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1500 MAV_CMD_DO_SET_ROI_NONE = 197,
1501 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1502 MAV_CMD_DO_SET_ROI_SYSID = 198,
1503 #[doc = "Control onboard camera system."]
1504 MAV_CMD_DO_CONTROL_VIDEO = 200,
1505 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1506 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1507 MAV_CMD_DO_SET_ROI = 201,
1508 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1509 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1510 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1511 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1512 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1513 #[doc = "Mission command to configure a camera or antenna mount"]
1514 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1515 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1516 #[doc = "Mission command to control a camera or antenna mount"]
1517 MAV_CMD_DO_MOUNT_CONTROL = 205,
1518 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1519 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1520 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1521 MAV_CMD_DO_FENCE_ENABLE = 207,
1522 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1523 MAV_CMD_DO_PARACHUTE = 208,
1524 #[doc = "Command to perform motor test."]
1525 MAV_CMD_DO_MOTOR_TEST = 209,
1526 #[doc = "Change to/from inverted flight."]
1527 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1528 #[doc = "Mission command to operate a gripper."]
1529 MAV_CMD_DO_GRIPPER = 211,
1530 #[doc = "Enable/disable autotune."]
1531 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1532 #[doc = "Sets a desired vehicle turn angle and speed change."]
1533 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1534 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1535 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1536 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1537 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1538 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1539 #[doc = "set id of master controller"]
1540 MAV_CMD_DO_GUIDED_MASTER = 221,
1541 #[doc = "Set limits for external control"]
1542 MAV_CMD_DO_GUIDED_LIMITS = 222,
1543 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1544 MAV_CMD_DO_ENGINE_CONTROL = 223,
1545 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1546 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1547 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1548 MAV_CMD_DO_LAST = 240,
1549 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1550 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1551 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1552 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1553 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1554 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1555 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1556 MAV_CMD_PREFLIGHT_STORAGE = 245,
1557 #[doc = "Request the reboot or shutdown of system components."]
1558 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1559 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1560 MAV_CMD_OVERRIDE_GOTO = 252,
1561 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1562 MAV_CMD_OBLIQUE_SURVEY = 260,
1563 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1564 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1565 #[doc = "start running a mission"]
1566 MAV_CMD_MISSION_START = 300,
1567 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1568 MAV_CMD_ACTUATOR_TEST = 310,
1569 #[doc = "Actuator configuration command."]
1570 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1571 #[doc = "Arms / Disarms a component"]
1572 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1573 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1574 MAV_CMD_RUN_PREARM_CHECKS = 401,
1575 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1576 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1577 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1578 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1579 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1580 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1581 MAV_CMD_GET_HOME_POSITION = 410,
1582 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1583 MAV_CMD_INJECT_FAILURE = 420,
1584 #[doc = "Starts receiver pairing."]
1585 MAV_CMD_START_RX_PAIR = 500,
1586 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1587 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1588 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1589 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1590 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1591 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1592 MAV_CMD_REQUEST_MESSAGE = 512,
1593 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1594 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1595 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1596 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1597 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1598 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1599 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1600 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1601 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1602 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1603 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1604 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1605 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1606 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1607 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1608 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1609 MAV_CMD_STORAGE_FORMAT = 526,
1610 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1611 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1612 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1613 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1614 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1615 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1616 #[doc = "Reset all camera settings to Factory Default"]
1617 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1618 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1619 MAV_CMD_SET_CAMERA_MODE = 530,
1620 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1621 MAV_CMD_SET_CAMERA_ZOOM = 531,
1622 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1623 MAV_CMD_SET_CAMERA_FOCUS = 532,
1624 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1625 MAV_CMD_SET_STORAGE_USAGE = 533,
1626 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1627 MAV_CMD_SET_CAMERA_SOURCE = 534,
1628 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1629 MAV_CMD_JUMP_TAG = 600,
1630 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1631 MAV_CMD_DO_JUMP_TAG = 601,
1632 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1633 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1634 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1635 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1636 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1637 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1638 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1639 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1640 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1641 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1642 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1643 #[doc = "Enable or disable on-board camera triggering system."]
1644 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1645 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1646 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1647 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1648 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1649 #[doc = "Stops ongoing tracking."]
1650 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1651 #[doc = "Starts video capture (recording)."]
1652 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1653 #[doc = "Stop the current video capture (recording)."]
1654 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1655 #[doc = "Start video streaming"]
1656 MAV_CMD_VIDEO_START_STREAMING = 2502,
1657 #[doc = "Stop the given video stream"]
1658 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1659 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1660 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1661 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1662 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1663 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1664 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1665 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1666 MAV_CMD_LOGGING_START = 2510,
1667 #[doc = "Request to stop streaming log data over MAVLink"]
1668 MAV_CMD_LOGGING_STOP = 2511,
1669 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1670 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1671 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1672 #[doc = "Create a panorama at the current position"]
1673 MAV_CMD_PANORAMA_CREATE = 2800,
1674 #[doc = "Request VTOL transition"]
1675 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1676 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1677 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1678 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1679 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1680 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1681 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1682 #[doc = "Delay mission state machine until gate has been reached."]
1683 MAV_CMD_CONDITION_GATE = 4501,
1684 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1685 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1686 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1687 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1688 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1689 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1690 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1691 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1692 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1693 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1694 #[doc = "Rally point. You can have multiple rally points defined."]
1695 MAV_CMD_NAV_RALLY_POINT = 5100,
1696 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1697 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1698 #[doc = "Change state of safety switch."]
1699 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1700 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1701 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1702 #[deprecated = " (Deprecated since 2021-06)"]
1703 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1704 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1705 #[deprecated = " (Deprecated since 2021-06)"]
1706 #[doc = "Control the payload deployment."]
1707 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1708 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1709 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1710 #[doc = "Command to operate winch."]
1711 MAV_CMD_DO_WINCH = 42600,
1712 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1713 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1714 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1715 MAV_CMD_WAYPOINT_USER_1 = 31000,
1716 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1717 MAV_CMD_WAYPOINT_USER_2 = 31001,
1718 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1719 MAV_CMD_WAYPOINT_USER_3 = 31002,
1720 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1721 MAV_CMD_WAYPOINT_USER_4 = 31003,
1722 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1723 MAV_CMD_WAYPOINT_USER_5 = 31004,
1724 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1725 MAV_CMD_SPATIAL_USER_1 = 31005,
1726 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1727 MAV_CMD_SPATIAL_USER_2 = 31006,
1728 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1729 MAV_CMD_SPATIAL_USER_3 = 31007,
1730 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1731 MAV_CMD_SPATIAL_USER_4 = 31008,
1732 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1733 MAV_CMD_SPATIAL_USER_5 = 31009,
1734 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1735 MAV_CMD_USER_1 = 31010,
1736 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1737 MAV_CMD_USER_2 = 31011,
1738 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1739 MAV_CMD_USER_3 = 31012,
1740 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1741 MAV_CMD_USER_4 = 31013,
1742 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1743 MAV_CMD_USER_5 = 31014,
1744 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1745 MAV_CMD_CAN_FORWARD = 32000,
1746 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1747 MAV_CMD_PREFLIGHT_STORAGE_ADVANCED = 0,
1748}
1749impl MavCmd {
1750 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1751}
1752impl Default for MavCmd {
1753 fn default() -> Self {
1754 Self::DEFAULT
1755 }
1756}
1757#[cfg_attr(feature = "ts", derive(TS))]
1758#[cfg_attr(feature = "ts", ts(export))]
1759#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1760#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1761#[cfg_attr(feature = "serde", serde(tag = "type"))]
1762#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1763#[repr(u32)]
1764#[doc = "Possible actions an aircraft can take to avoid a collision."]
1765pub enum MavCollisionAction {
1766 #[doc = "Ignore any potential collisions"]
1767 MAV_COLLISION_ACTION_NONE = 0,
1768 #[doc = "Report potential collision"]
1769 MAV_COLLISION_ACTION_REPORT = 1,
1770 #[doc = "Ascend or Descend to avoid threat"]
1771 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1772 #[doc = "Move horizontally to avoid threat"]
1773 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1774 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1775 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1776 #[doc = "Aircraft to fly directly back to its launch point"]
1777 MAV_COLLISION_ACTION_RTL = 5,
1778 #[doc = "Aircraft to stop in place"]
1779 MAV_COLLISION_ACTION_HOVER = 6,
1780}
1781impl MavCollisionAction {
1782 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1783}
1784impl Default for MavCollisionAction {
1785 fn default() -> Self {
1786 Self::DEFAULT
1787 }
1788}
1789#[cfg_attr(feature = "ts", derive(TS))]
1790#[cfg_attr(feature = "ts", ts(export))]
1791#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1792#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1793#[cfg_attr(feature = "serde", serde(tag = "type"))]
1794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1795#[repr(u32)]
1796#[doc = "Source of information about this collision."]
1797pub enum MavCollisionSrc {
1798 #[doc = "ID field references ADSB_VEHICLE packets"]
1799 MAV_COLLISION_SRC_ADSB = 0,
1800 #[doc = "ID field references MAVLink SRC ID"]
1801 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1802}
1803impl MavCollisionSrc {
1804 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1805}
1806impl Default for MavCollisionSrc {
1807 fn default() -> Self {
1808 Self::DEFAULT
1809 }
1810}
1811#[cfg_attr(feature = "ts", derive(TS))]
1812#[cfg_attr(feature = "ts", ts(export))]
1813#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1814#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1815#[cfg_attr(feature = "serde", serde(tag = "type"))]
1816#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1817#[repr(u32)]
1818#[doc = "Aircraft-rated danger from this threat."]
1819pub enum MavCollisionThreatLevel {
1820 #[doc = "Not a threat"]
1821 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1822 #[doc = "Craft is mildly concerned about this threat"]
1823 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1824 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1825 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1826}
1827impl MavCollisionThreatLevel {
1828 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1829}
1830impl Default for MavCollisionThreatLevel {
1831 fn default() -> Self {
1832 Self::DEFAULT
1833 }
1834}
1835#[cfg_attr(feature = "ts", derive(TS))]
1836#[cfg_attr(feature = "ts", ts(export))]
1837#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1838#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1839#[cfg_attr(feature = "serde", serde(tag = "type"))]
1840#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1841#[repr(u32)]
1842#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1843pub enum MavComponent {
1844 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1845 MAV_COMP_ID_ALL = 0,
1846 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1847 MAV_COMP_ID_AUTOPILOT1 = 1,
1848 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1849 MAV_COMP_ID_USER1 = 25,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER2 = 26,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER3 = 27,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER4 = 28,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER5 = 29,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER6 = 30,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER7 = 31,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER8 = 32,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER9 = 33,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER10 = 34,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER11 = 35,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER12 = 36,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER13 = 37,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER14 = 38,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER15 = 39,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER16 = 40,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER17 = 41,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER18 = 42,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER19 = 43,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER20 = 44,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER21 = 45,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER22 = 46,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER23 = 47,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER24 = 48,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER25 = 49,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER26 = 50,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER27 = 51,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER28 = 52,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER29 = 53,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER30 = 54,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER31 = 55,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER32 = 56,
1912 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1913 MAV_COMP_ID_USER33 = 57,
1914 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1915 MAV_COMP_ID_USER34 = 58,
1916 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1917 MAV_COMP_ID_USER35 = 59,
1918 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1919 MAV_COMP_ID_USER36 = 60,
1920 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1921 MAV_COMP_ID_USER37 = 61,
1922 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1923 MAV_COMP_ID_USER38 = 62,
1924 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1925 MAV_COMP_ID_USER39 = 63,
1926 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1927 MAV_COMP_ID_USER40 = 64,
1928 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1929 MAV_COMP_ID_USER41 = 65,
1930 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1931 MAV_COMP_ID_USER42 = 66,
1932 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1933 MAV_COMP_ID_USER43 = 67,
1934 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1935 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1936 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1937 MAV_COMP_ID_USER45 = 69,
1938 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1939 MAV_COMP_ID_USER46 = 70,
1940 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1941 MAV_COMP_ID_USER47 = 71,
1942 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1943 MAV_COMP_ID_USER48 = 72,
1944 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1945 MAV_COMP_ID_USER49 = 73,
1946 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1947 MAV_COMP_ID_USER50 = 74,
1948 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1949 MAV_COMP_ID_USER51 = 75,
1950 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1951 MAV_COMP_ID_USER52 = 76,
1952 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1953 MAV_COMP_ID_USER53 = 77,
1954 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1955 MAV_COMP_ID_USER54 = 78,
1956 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1957 MAV_COMP_ID_USER55 = 79,
1958 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1959 MAV_COMP_ID_USER56 = 80,
1960 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1961 MAV_COMP_ID_USER57 = 81,
1962 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1963 MAV_COMP_ID_USER58 = 82,
1964 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1965 MAV_COMP_ID_USER59 = 83,
1966 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1967 MAV_COMP_ID_USER60 = 84,
1968 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1969 MAV_COMP_ID_USER61 = 85,
1970 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1971 MAV_COMP_ID_USER62 = 86,
1972 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1973 MAV_COMP_ID_USER63 = 87,
1974 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1975 MAV_COMP_ID_USER64 = 88,
1976 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1977 MAV_COMP_ID_USER65 = 89,
1978 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1979 MAV_COMP_ID_USER66 = 90,
1980 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1981 MAV_COMP_ID_USER67 = 91,
1982 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1983 MAV_COMP_ID_USER68 = 92,
1984 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1985 MAV_COMP_ID_USER69 = 93,
1986 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1987 MAV_COMP_ID_USER70 = 94,
1988 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1989 MAV_COMP_ID_USER71 = 95,
1990 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1991 MAV_COMP_ID_USER72 = 96,
1992 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1993 MAV_COMP_ID_USER73 = 97,
1994 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1995 MAV_COMP_ID_USER74 = 98,
1996 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1997 MAV_COMP_ID_USER75 = 99,
1998 #[doc = "Camera #1."]
1999 MAV_COMP_ID_CAMERA = 100,
2000 #[doc = "Camera #2."]
2001 MAV_COMP_ID_CAMERA2 = 101,
2002 #[doc = "Camera #3."]
2003 MAV_COMP_ID_CAMERA3 = 102,
2004 #[doc = "Camera #4."]
2005 MAV_COMP_ID_CAMERA4 = 103,
2006 #[doc = "Camera #5."]
2007 MAV_COMP_ID_CAMERA5 = 104,
2008 #[doc = "Camera #6."]
2009 MAV_COMP_ID_CAMERA6 = 105,
2010 #[doc = "Servo #1."]
2011 MAV_COMP_ID_SERVO1 = 140,
2012 #[doc = "Servo #2."]
2013 MAV_COMP_ID_SERVO2 = 141,
2014 #[doc = "Servo #3."]
2015 MAV_COMP_ID_SERVO3 = 142,
2016 #[doc = "Servo #4."]
2017 MAV_COMP_ID_SERVO4 = 143,
2018 #[doc = "Servo #5."]
2019 MAV_COMP_ID_SERVO5 = 144,
2020 #[doc = "Servo #6."]
2021 MAV_COMP_ID_SERVO6 = 145,
2022 #[doc = "Servo #7."]
2023 MAV_COMP_ID_SERVO7 = 146,
2024 #[doc = "Servo #8."]
2025 MAV_COMP_ID_SERVO8 = 147,
2026 #[doc = "Servo #9."]
2027 MAV_COMP_ID_SERVO9 = 148,
2028 #[doc = "Servo #10."]
2029 MAV_COMP_ID_SERVO10 = 149,
2030 #[doc = "Servo #11."]
2031 MAV_COMP_ID_SERVO11 = 150,
2032 #[doc = "Servo #12."]
2033 MAV_COMP_ID_SERVO12 = 151,
2034 #[doc = "Servo #13."]
2035 MAV_COMP_ID_SERVO13 = 152,
2036 #[doc = "Servo #14."]
2037 MAV_COMP_ID_SERVO14 = 153,
2038 #[doc = "Gimbal #1."]
2039 MAV_COMP_ID_GIMBAL = 154,
2040 #[doc = "Logging component."]
2041 MAV_COMP_ID_LOG = 155,
2042 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2043 MAV_COMP_ID_ADSB = 156,
2044 #[doc = "On Screen Display (OSD) devices for video links."]
2045 MAV_COMP_ID_OSD = 157,
2046 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2047 MAV_COMP_ID_PERIPHERAL = 158,
2048 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2049 #[doc = "Gimbal ID for QX1."]
2050 MAV_COMP_ID_QX1_GIMBAL = 159,
2051 #[doc = "FLARM collision alert component."]
2052 MAV_COMP_ID_FLARM = 160,
2053 #[doc = "Parachute component."]
2054 MAV_COMP_ID_PARACHUTE = 161,
2055 #[doc = "Winch component."]
2056 MAV_COMP_ID_WINCH = 169,
2057 #[doc = "Gimbal #2."]
2058 MAV_COMP_ID_GIMBAL2 = 171,
2059 #[doc = "Gimbal #3."]
2060 MAV_COMP_ID_GIMBAL3 = 172,
2061 #[doc = "Gimbal #4"]
2062 MAV_COMP_ID_GIMBAL4 = 173,
2063 #[doc = "Gimbal #5."]
2064 MAV_COMP_ID_GIMBAL5 = 174,
2065 #[doc = "Gimbal #6."]
2066 MAV_COMP_ID_GIMBAL6 = 175,
2067 #[doc = "Battery #1."]
2068 MAV_COMP_ID_BATTERY = 180,
2069 #[doc = "Battery #2."]
2070 MAV_COMP_ID_BATTERY2 = 181,
2071 #[doc = "CAN over MAVLink client."]
2072 MAV_COMP_ID_MAVCAN = 189,
2073 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2074 MAV_COMP_ID_MISSIONPLANNER = 190,
2075 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2076 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2077 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2078 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2079 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2080 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2081 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2082 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2083 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2084 MAV_COMP_ID_PATHPLANNER = 195,
2085 #[doc = "Component that plans a collision free path between two points."]
2086 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2087 #[doc = "Component that provides position estimates using VIO techniques."]
2088 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2089 #[doc = "Component that manages pairing of vehicle and GCS."]
2090 MAV_COMP_ID_PAIRING_MANAGER = 198,
2091 #[doc = "Inertial Measurement Unit (IMU) #1."]
2092 MAV_COMP_ID_IMU = 200,
2093 #[doc = "Inertial Measurement Unit (IMU) #2."]
2094 MAV_COMP_ID_IMU_2 = 201,
2095 #[doc = "Inertial Measurement Unit (IMU) #3."]
2096 MAV_COMP_ID_IMU_3 = 202,
2097 #[doc = "GPS #1."]
2098 MAV_COMP_ID_GPS = 220,
2099 #[doc = "GPS #2."]
2100 MAV_COMP_ID_GPS2 = 221,
2101 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2102 MAV_COMP_ID_ODID_TXRX_1 = 236,
2103 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2104 MAV_COMP_ID_ODID_TXRX_2 = 237,
2105 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2106 MAV_COMP_ID_ODID_TXRX_3 = 238,
2107 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2108 MAV_COMP_ID_UDP_BRIDGE = 240,
2109 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2110 MAV_COMP_ID_UART_BRIDGE = 241,
2111 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2112 MAV_COMP_ID_TUNNEL_NODE = 242,
2113 #[doc = "Illuminator"]
2114 MAV_COMP_ID_ILLUMINATOR = 243,
2115 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2116 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2117 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2118}
2119impl MavComponent {
2120 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2121}
2122impl Default for MavComponent {
2123 fn default() -> Self {
2124 Self::DEFAULT
2125 }
2126}
2127#[cfg_attr(feature = "ts", derive(TS))]
2128#[cfg_attr(feature = "ts", ts(export))]
2129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2131#[cfg_attr(feature = "serde", serde(tag = "type"))]
2132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2133#[repr(u32)]
2134#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2135#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2136pub enum MavDataStream {
2137 #[doc = "Enable all data streams"]
2138 MAV_DATA_STREAM_ALL = 0,
2139 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2140 MAV_DATA_STREAM_RAW_SENSORS = 1,
2141 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2142 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2143 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2144 MAV_DATA_STREAM_RC_CHANNELS = 3,
2145 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2146 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2147 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2148 MAV_DATA_STREAM_POSITION = 6,
2149 #[doc = "Dependent on the autopilot"]
2150 MAV_DATA_STREAM_EXTRA1 = 10,
2151 #[doc = "Dependent on the autopilot"]
2152 MAV_DATA_STREAM_EXTRA2 = 11,
2153 #[doc = "Dependent on the autopilot"]
2154 MAV_DATA_STREAM_EXTRA3 = 12,
2155}
2156impl MavDataStream {
2157 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2158}
2159impl Default for MavDataStream {
2160 fn default() -> Self {
2161 Self::DEFAULT
2162 }
2163}
2164#[cfg_attr(feature = "ts", derive(TS))]
2165#[cfg_attr(feature = "ts", ts(export))]
2166#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2168#[cfg_attr(feature = "serde", serde(tag = "type"))]
2169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2170#[repr(u32)]
2171#[doc = "Enumeration of distance sensor types"]
2172pub enum MavDistanceSensor {
2173 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2174 MAV_DISTANCE_SENSOR_LASER = 0,
2175 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2176 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2177 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2178 MAV_DISTANCE_SENSOR_INFRARED = 2,
2179 #[doc = "Radar type, e.g. uLanding units"]
2180 MAV_DISTANCE_SENSOR_RADAR = 3,
2181 #[doc = "Broken or unknown type, e.g. analog units"]
2182 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2183}
2184impl MavDistanceSensor {
2185 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2186}
2187impl Default for MavDistanceSensor {
2188 fn default() -> Self {
2189 Self::DEFAULT
2190 }
2191}
2192#[cfg_attr(feature = "ts", derive(TS))]
2193#[cfg_attr(feature = "ts", ts(export))]
2194#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2195#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2196#[cfg_attr(feature = "serde", serde(tag = "type"))]
2197#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2198#[repr(u32)]
2199#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2200pub enum MavDoRepositionFlags {
2201 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2202 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2203}
2204impl MavDoRepositionFlags {
2205 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2206}
2207impl Default for MavDoRepositionFlags {
2208 fn default() -> Self {
2209 Self::DEFAULT
2210 }
2211}
2212#[cfg_attr(feature = "ts", derive(TS))]
2213#[cfg_attr(feature = "ts", ts(export))]
2214#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2216#[cfg_attr(feature = "serde", serde(tag = "type"))]
2217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2218#[repr(u32)]
2219#[doc = "Enumeration of estimator types"]
2220pub enum MavEstimatorType {
2221 #[doc = "Unknown type of the estimator."]
2222 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2223 #[doc = "This is a naive estimator without any real covariance feedback."]
2224 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2225 #[doc = "Computer vision based estimate. Might be up to scale."]
2226 MAV_ESTIMATOR_TYPE_VISION = 2,
2227 #[doc = "Visual-inertial estimate."]
2228 MAV_ESTIMATOR_TYPE_VIO = 3,
2229 #[doc = "Plain GPS estimate."]
2230 MAV_ESTIMATOR_TYPE_GPS = 4,
2231 #[doc = "Estimator integrating GPS and inertial sensing."]
2232 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2233 #[doc = "Estimate from external motion capturing system."]
2234 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2235 #[doc = "Estimator based on lidar sensor input."]
2236 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2237 #[doc = "Estimator on autopilot."]
2238 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2239}
2240impl MavEstimatorType {
2241 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2242}
2243impl Default for MavEstimatorType {
2244 fn default() -> Self {
2245 Self::DEFAULT
2246 }
2247}
2248#[cfg_attr(feature = "ts", derive(TS))]
2249#[cfg_attr(feature = "ts", ts(export))]
2250#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2251#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2252#[cfg_attr(feature = "serde", serde(tag = "type"))]
2253#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2254#[repr(u32)]
2255#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2256pub enum MavEventCurrentSequenceFlags {
2257 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2258 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2259}
2260impl MavEventCurrentSequenceFlags {
2261 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2262}
2263impl Default for MavEventCurrentSequenceFlags {
2264 fn default() -> Self {
2265 Self::DEFAULT
2266 }
2267}
2268#[cfg_attr(feature = "ts", derive(TS))]
2269#[cfg_attr(feature = "ts", ts(export))]
2270#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2272#[cfg_attr(feature = "serde", serde(tag = "type"))]
2273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2274#[repr(u32)]
2275#[doc = "Reason for an event error response."]
2276pub enum MavEventErrorReason {
2277 #[doc = "The requested event is not available (anymore)."]
2278 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2279}
2280impl MavEventErrorReason {
2281 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2282}
2283impl Default for MavEventErrorReason {
2284 fn default() -> Self {
2285 Self::DEFAULT
2286 }
2287}
2288#[cfg_attr(feature = "ts", derive(TS))]
2289#[cfg_attr(feature = "ts", ts(export))]
2290#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2291#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2292#[cfg_attr(feature = "serde", serde(tag = "type"))]
2293#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2294#[repr(u32)]
2295#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2296pub enum MavFrame {
2297 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2298 MAV_FRAME_GLOBAL = 0,
2299 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2300 MAV_FRAME_LOCAL_NED = 1,
2301 #[doc = "NOT a coordinate frame, indicates a mission command."]
2302 MAV_FRAME_MISSION = 2,
2303 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2304 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2305 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2306 MAV_FRAME_LOCAL_ENU = 4,
2307 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2308 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2309 MAV_FRAME_GLOBAL_INT = 5,
2310 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2311 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2312 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2313 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2314 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2315 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2316 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2317 MAV_FRAME_BODY_NED = 8,
2318 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2319 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2320 MAV_FRAME_BODY_OFFSET_NED = 9,
2321 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2322 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2323 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2324 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2325 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2326 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2327 MAV_FRAME_BODY_FRD = 12,
2328 #[deprecated = " (Deprecated since 2019-04)"]
2329 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2330 MAV_FRAME_RESERVED_13 = 13,
2331 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2332 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2333 MAV_FRAME_RESERVED_14 = 14,
2334 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2335 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2336 MAV_FRAME_RESERVED_15 = 15,
2337 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2338 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2339 MAV_FRAME_RESERVED_16 = 16,
2340 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2341 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2342 MAV_FRAME_RESERVED_17 = 17,
2343 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2344 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2345 MAV_FRAME_RESERVED_18 = 18,
2346 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2347 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2348 MAV_FRAME_RESERVED_19 = 19,
2349 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2350 MAV_FRAME_LOCAL_FRD = 20,
2351 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2352 MAV_FRAME_LOCAL_FLU = 21,
2353}
2354impl MavFrame {
2355 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2356}
2357impl Default for MavFrame {
2358 fn default() -> Self {
2359 Self::DEFAULT
2360 }
2361}
2362#[cfg_attr(feature = "ts", derive(TS))]
2363#[cfg_attr(feature = "ts", ts(export))]
2364#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2366#[cfg_attr(feature = "serde", serde(tag = "type"))]
2367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2368#[repr(u32)]
2369#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2370pub enum MavFtpErr {
2371 #[doc = "None: No error"]
2372 MAV_FTP_ERR_NONE = 0,
2373 #[doc = "Fail: Unknown failure"]
2374 MAV_FTP_ERR_FAIL = 1,
2375 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2376 MAV_FTP_ERR_FAILERRNO = 2,
2377 #[doc = "InvalidDataSize: Payload size is invalid"]
2378 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2379 #[doc = "InvalidSession: Session is not currently open"]
2380 MAV_FTP_ERR_INVALIDSESSION = 4,
2381 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2382 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2383 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2384 MAV_FTP_ERR_EOF = 6,
2385 #[doc = "UnknownCommand: Unknown command / opcode"]
2386 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2387 #[doc = "FileExists: File/directory already exists"]
2388 MAV_FTP_ERR_FILEEXISTS = 8,
2389 #[doc = "FileProtected: File/directory is write protected"]
2390 MAV_FTP_ERR_FILEPROTECTED = 9,
2391 #[doc = "FileNotFound: File/directory not found"]
2392 MAV_FTP_ERR_FILENOTFOUND = 10,
2393}
2394impl MavFtpErr {
2395 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2396}
2397impl Default for MavFtpErr {
2398 fn default() -> Self {
2399 Self::DEFAULT
2400 }
2401}
2402#[cfg_attr(feature = "ts", derive(TS))]
2403#[cfg_attr(feature = "ts", ts(export))]
2404#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2406#[cfg_attr(feature = "serde", serde(tag = "type"))]
2407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2408#[repr(u32)]
2409#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2410pub enum MavFtpOpcode {
2411 #[doc = "None. Ignored, always ACKed"]
2412 MAV_FTP_OPCODE_NONE = 0,
2413 #[doc = "TerminateSession: Terminates open Read session"]
2414 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2415 #[doc = "ResetSessions: Terminates all open read sessions"]
2416 MAV_FTP_OPCODE_RESETSESSION = 2,
2417 #[doc = "ListDirectory. List files and directories in path from offset"]
2418 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2419 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2420 MAV_FTP_OPCODE_OPENFILERO = 4,
2421 #[doc = "ReadFile: Reads size bytes from offset in session"]
2422 MAV_FTP_OPCODE_READFILE = 5,
2423 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2424 MAV_FTP_OPCODE_CREATEFILE = 6,
2425 #[doc = "WriteFile: Writes size bytes to offset in session"]
2426 MAV_FTP_OPCODE_WRITEFILE = 7,
2427 #[doc = "RemoveFile: Remove file at path"]
2428 MAV_FTP_OPCODE_REMOVEFILE = 8,
2429 #[doc = "CreateDirectory: Creates directory at path"]
2430 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2431 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2432 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2433 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2434 MAV_FTP_OPCODE_OPENFILEWO = 11,
2435 #[doc = "TruncateFile: Truncate file at path to offset length"]
2436 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2437 #[doc = "Rename: Rename path1 to path2"]
2438 MAV_FTP_OPCODE_RENAME = 13,
2439 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2440 MAV_FTP_OPCODE_CALCFILECRC = 14,
2441 #[doc = "BurstReadFile: Burst download session file"]
2442 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2443 #[doc = "ACK: ACK response"]
2444 MAV_FTP_OPCODE_ACK = 128,
2445 #[doc = "NAK: NAK response"]
2446 MAV_FTP_OPCODE_NAK = 129,
2447}
2448impl MavFtpOpcode {
2449 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2450}
2451impl Default for MavFtpOpcode {
2452 fn default() -> Self {
2453 Self::DEFAULT
2454 }
2455}
2456#[cfg_attr(feature = "ts", derive(TS))]
2457#[cfg_attr(feature = "ts", ts(export))]
2458#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2459#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2460#[cfg_attr(feature = "serde", serde(tag = "type"))]
2461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2462#[repr(u32)]
2463#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2464pub enum MavFuelType {
2465 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2466 MAV_FUEL_TYPE_UNKNOWN = 0,
2467 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2468 MAV_FUEL_TYPE_LIQUID = 1,
2469 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2470 MAV_FUEL_TYPE_GAS = 2,
2471}
2472impl MavFuelType {
2473 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2474}
2475impl Default for MavFuelType {
2476 fn default() -> Self {
2477 Self::DEFAULT
2478 }
2479}
2480bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2481impl MavGeneratorStatusFlag {
2482 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2483}
2484impl Default for MavGeneratorStatusFlag {
2485 fn default() -> Self {
2486 Self::DEFAULT
2487 }
2488}
2489#[cfg_attr(feature = "ts", derive(TS))]
2490#[cfg_attr(feature = "ts", ts(export))]
2491#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2492#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2493#[cfg_attr(feature = "serde", serde(tag = "type"))]
2494#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2495#[repr(u32)]
2496#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2497pub enum MavGoto {
2498 #[doc = "Hold at the current position."]
2499 MAV_GOTO_DO_HOLD = 0,
2500 #[doc = "Continue with the next item in mission execution."]
2501 MAV_GOTO_DO_CONTINUE = 1,
2502 #[doc = "Hold at the current position of the system"]
2503 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2504 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2505 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2506}
2507impl MavGoto {
2508 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2509}
2510impl Default for MavGoto {
2511 fn default() -> Self {
2512 Self::DEFAULT
2513 }
2514}
2515#[cfg_attr(feature = "ts", derive(TS))]
2516#[cfg_attr(feature = "ts", ts(export))]
2517#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2518#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2519#[cfg_attr(feature = "serde", serde(tag = "type"))]
2520#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2521#[repr(u32)]
2522#[doc = "Enumeration of landed detector states"]
2523pub enum MavLandedState {
2524 #[doc = "MAV landed state is unknown"]
2525 MAV_LANDED_STATE_UNDEFINED = 0,
2526 #[doc = "MAV is landed (on ground)"]
2527 MAV_LANDED_STATE_ON_GROUND = 1,
2528 #[doc = "MAV is in air"]
2529 MAV_LANDED_STATE_IN_AIR = 2,
2530 #[doc = "MAV currently taking off"]
2531 MAV_LANDED_STATE_TAKEOFF = 3,
2532 #[doc = "MAV currently landing"]
2533 MAV_LANDED_STATE_LANDING = 4,
2534}
2535impl MavLandedState {
2536 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2537}
2538impl Default for MavLandedState {
2539 fn default() -> Self {
2540 Self::DEFAULT
2541 }
2542}
2543#[cfg_attr(feature = "ts", derive(TS))]
2544#[cfg_attr(feature = "ts", ts(export))]
2545#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2547#[cfg_attr(feature = "serde", serde(tag = "type"))]
2548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2549#[repr(u32)]
2550#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2551pub enum MavMissionResult {
2552 #[doc = "mission accepted OK"]
2553 MAV_MISSION_ACCEPTED = 0,
2554 #[doc = "Generic error / not accepting mission commands at all right now."]
2555 MAV_MISSION_ERROR = 1,
2556 #[doc = "Coordinate frame is not supported."]
2557 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2558 #[doc = "Command is not supported."]
2559 MAV_MISSION_UNSUPPORTED = 3,
2560 #[doc = "Mission items exceed storage space."]
2561 MAV_MISSION_NO_SPACE = 4,
2562 #[doc = "One of the parameters has an invalid value."]
2563 MAV_MISSION_INVALID = 5,
2564 #[doc = "param1 has an invalid value."]
2565 MAV_MISSION_INVALID_PARAM1 = 6,
2566 #[doc = "param2 has an invalid value."]
2567 MAV_MISSION_INVALID_PARAM2 = 7,
2568 #[doc = "param3 has an invalid value."]
2569 MAV_MISSION_INVALID_PARAM3 = 8,
2570 #[doc = "param4 has an invalid value."]
2571 MAV_MISSION_INVALID_PARAM4 = 9,
2572 #[doc = "x / param5 has an invalid value."]
2573 MAV_MISSION_INVALID_PARAM5_X = 10,
2574 #[doc = "y / param6 has an invalid value."]
2575 MAV_MISSION_INVALID_PARAM6_Y = 11,
2576 #[doc = "z / param7 has an invalid value."]
2577 MAV_MISSION_INVALID_PARAM7 = 12,
2578 #[doc = "Mission item received out of sequence"]
2579 MAV_MISSION_INVALID_SEQUENCE = 13,
2580 #[doc = "Not accepting any mission commands from this communication partner."]
2581 MAV_MISSION_DENIED = 14,
2582 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2583 MAV_MISSION_OPERATION_CANCELLED = 15,
2584}
2585impl MavMissionResult {
2586 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2587}
2588impl Default for MavMissionResult {
2589 fn default() -> Self {
2590 Self::DEFAULT
2591 }
2592}
2593#[cfg_attr(feature = "ts", derive(TS))]
2594#[cfg_attr(feature = "ts", ts(export))]
2595#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2597#[cfg_attr(feature = "serde", serde(tag = "type"))]
2598#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2599#[repr(u32)]
2600#[doc = "Type of mission items being requested/sent in mission protocol."]
2601pub enum MavMissionType {
2602 #[doc = "Items are mission commands for main mission."]
2603 MAV_MISSION_TYPE_MISSION = 0,
2604 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2605 MAV_MISSION_TYPE_FENCE = 1,
2606 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2607 MAV_MISSION_TYPE_RALLY = 2,
2608 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2609 MAV_MISSION_TYPE_ALL = 255,
2610}
2611impl MavMissionType {
2612 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2613}
2614impl Default for MavMissionType {
2615 fn default() -> Self {
2616 Self::DEFAULT
2617 }
2618}
2619#[cfg_attr(feature = "ts", derive(TS))]
2620#[cfg_attr(feature = "ts", ts(export))]
2621#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2622#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2623#[cfg_attr(feature = "serde", serde(tag = "type"))]
2624#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2625#[repr(u32)]
2626#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2627pub enum MavMode {
2628 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2629 MAV_MODE_PREFLIGHT = 0,
2630 #[doc = "System is allowed to be active, under assisted RC control."]
2631 MAV_MODE_STABILIZE_DISARMED = 80,
2632 #[doc = "System is allowed to be active, under assisted RC control."]
2633 MAV_MODE_STABILIZE_ARMED = 208,
2634 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2635 MAV_MODE_MANUAL_DISARMED = 64,
2636 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2637 MAV_MODE_MANUAL_ARMED = 192,
2638 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2639 MAV_MODE_GUIDED_DISARMED = 88,
2640 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2641 MAV_MODE_GUIDED_ARMED = 216,
2642 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2643 MAV_MODE_AUTO_DISARMED = 92,
2644 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2645 MAV_MODE_AUTO_ARMED = 220,
2646 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2647 MAV_MODE_TEST_DISARMED = 66,
2648 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2649 MAV_MODE_TEST_ARMED = 194,
2650}
2651impl MavMode {
2652 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2653}
2654impl Default for MavMode {
2655 fn default() -> Self {
2656 Self::DEFAULT
2657 }
2658}
2659bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2660impl MavModeFlag {
2661 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2662}
2663impl Default for MavModeFlag {
2664 fn default() -> Self {
2665 Self::DEFAULT
2666 }
2667}
2668#[cfg_attr(feature = "ts", derive(TS))]
2669#[cfg_attr(feature = "ts", ts(export))]
2670#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2672#[cfg_attr(feature = "serde", serde(tag = "type"))]
2673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2674#[repr(u32)]
2675#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2676pub enum MavModeFlagDecodePosition {
2677 #[doc = "First bit: 10000000"]
2678 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2679 #[doc = "Second bit: 01000000"]
2680 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2681 #[doc = "Third bit: 00100000"]
2682 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2683 #[doc = "Fourth bit: 00010000"]
2684 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2685 #[doc = "Fifth bit: 00001000"]
2686 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2687 #[doc = "Sixth bit: 00000100"]
2688 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2689 #[doc = "Seventh bit: 00000010"]
2690 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2691 #[doc = "Eighth bit: 00000001"]
2692 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2693}
2694impl MavModeFlagDecodePosition {
2695 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2696}
2697impl Default for MavModeFlagDecodePosition {
2698 fn default() -> Self {
2699 Self::DEFAULT
2700 }
2701}
2702bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2703impl MavModeProperty {
2704 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2705}
2706impl Default for MavModeProperty {
2707 fn default() -> Self {
2708 Self::DEFAULT
2709 }
2710}
2711#[cfg_attr(feature = "ts", derive(TS))]
2712#[cfg_attr(feature = "ts", ts(export))]
2713#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2714#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2715#[cfg_attr(feature = "serde", serde(tag = "type"))]
2716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2717#[repr(u32)]
2718#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2719#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2720pub enum MavMountMode {
2721 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2722 MAV_MOUNT_MODE_RETRACT = 0,
2723 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2724 MAV_MOUNT_MODE_NEUTRAL = 1,
2725 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2726 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2727 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2728 MAV_MOUNT_MODE_RC_TARGETING = 3,
2729 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2730 MAV_MOUNT_MODE_GPS_POINT = 4,
2731 #[doc = "Gimbal tracks system with specified system ID"]
2732 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2733 #[doc = "Gimbal tracks home position"]
2734 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2735}
2736impl MavMountMode {
2737 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2738}
2739impl Default for MavMountMode {
2740 fn default() -> Self {
2741 Self::DEFAULT
2742 }
2743}
2744#[cfg_attr(feature = "ts", derive(TS))]
2745#[cfg_attr(feature = "ts", ts(export))]
2746#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2747#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2748#[cfg_attr(feature = "serde", serde(tag = "type"))]
2749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2750#[repr(u32)]
2751pub enum MavOdidArmStatus {
2752 #[doc = "Passing arming checks."]
2753 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2754 #[doc = "Generic arming failure, see error string for details."]
2755 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2756}
2757impl MavOdidArmStatus {
2758 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2759}
2760impl Default for MavOdidArmStatus {
2761 fn default() -> Self {
2762 Self::DEFAULT
2763 }
2764}
2765#[cfg_attr(feature = "ts", derive(TS))]
2766#[cfg_attr(feature = "ts", ts(export))]
2767#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2768#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2769#[cfg_attr(feature = "serde", serde(tag = "type"))]
2770#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2771#[repr(u32)]
2772pub enum MavOdidAuthType {
2773 #[doc = "No authentication type is specified."]
2774 MAV_ODID_AUTH_TYPE_NONE = 0,
2775 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2776 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2777 #[doc = "Signature for the Operator ID."]
2778 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2779 #[doc = "Signature for the entire message set."]
2780 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2781 #[doc = "Authentication is provided by Network Remote ID."]
2782 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2783 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2784 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2785}
2786impl MavOdidAuthType {
2787 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2788}
2789impl Default for MavOdidAuthType {
2790 fn default() -> Self {
2791 Self::DEFAULT
2792 }
2793}
2794#[cfg_attr(feature = "ts", derive(TS))]
2795#[cfg_attr(feature = "ts", ts(export))]
2796#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2797#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2798#[cfg_attr(feature = "serde", serde(tag = "type"))]
2799#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2800#[repr(u32)]
2801pub enum MavOdidCategoryEu {
2802 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2803 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2804 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2805 MAV_ODID_CATEGORY_EU_OPEN = 1,
2806 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2807 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2808 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2809 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2810}
2811impl MavOdidCategoryEu {
2812 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2813}
2814impl Default for MavOdidCategoryEu {
2815 fn default() -> Self {
2816 Self::DEFAULT
2817 }
2818}
2819#[cfg_attr(feature = "ts", derive(TS))]
2820#[cfg_attr(feature = "ts", ts(export))]
2821#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2822#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2823#[cfg_attr(feature = "serde", serde(tag = "type"))]
2824#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2825#[repr(u32)]
2826pub enum MavOdidClassEu {
2827 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2828 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2829 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2830 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2831 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2832 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2833 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2834 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2835 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2836 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2837 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2838 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2839 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2840 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2841 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2842 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2843}
2844impl MavOdidClassEu {
2845 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2846}
2847impl Default for MavOdidClassEu {
2848 fn default() -> Self {
2849 Self::DEFAULT
2850 }
2851}
2852#[cfg_attr(feature = "ts", derive(TS))]
2853#[cfg_attr(feature = "ts", ts(export))]
2854#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2855#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2856#[cfg_attr(feature = "serde", serde(tag = "type"))]
2857#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2858#[repr(u32)]
2859pub enum MavOdidClassificationType {
2860 #[doc = "The classification type for the UA is undeclared."]
2861 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2862 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2863 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2864}
2865impl MavOdidClassificationType {
2866 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2867}
2868impl Default for MavOdidClassificationType {
2869 fn default() -> Self {
2870 Self::DEFAULT
2871 }
2872}
2873#[cfg_attr(feature = "ts", derive(TS))]
2874#[cfg_attr(feature = "ts", ts(export))]
2875#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2877#[cfg_attr(feature = "serde", serde(tag = "type"))]
2878#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2879#[repr(u32)]
2880pub enum MavOdidDescType {
2881 #[doc = "Optional free-form text description of the purpose of the flight."]
2882 MAV_ODID_DESC_TYPE_TEXT = 0,
2883 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2884 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2885 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2886 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2887}
2888impl MavOdidDescType {
2889 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2890}
2891impl Default for MavOdidDescType {
2892 fn default() -> Self {
2893 Self::DEFAULT
2894 }
2895}
2896#[cfg_attr(feature = "ts", derive(TS))]
2897#[cfg_attr(feature = "ts", ts(export))]
2898#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2899#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2900#[cfg_attr(feature = "serde", serde(tag = "type"))]
2901#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2902#[repr(u32)]
2903pub enum MavOdidHeightRef {
2904 #[doc = "The height field is relative to the take-off location."]
2905 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2906 #[doc = "The height field is relative to ground."]
2907 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2908}
2909impl MavOdidHeightRef {
2910 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2911}
2912impl Default for MavOdidHeightRef {
2913 fn default() -> Self {
2914 Self::DEFAULT
2915 }
2916}
2917#[cfg_attr(feature = "ts", derive(TS))]
2918#[cfg_attr(feature = "ts", ts(export))]
2919#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2921#[cfg_attr(feature = "serde", serde(tag = "type"))]
2922#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2923#[repr(u32)]
2924pub enum MavOdidHorAcc {
2925 #[doc = "The horizontal accuracy is unknown."]
2926 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2927 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2928 MAV_ODID_HOR_ACC_10NM = 1,
2929 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2930 MAV_ODID_HOR_ACC_4NM = 2,
2931 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2932 MAV_ODID_HOR_ACC_2NM = 3,
2933 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2934 MAV_ODID_HOR_ACC_1NM = 4,
2935 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2936 MAV_ODID_HOR_ACC_0_5NM = 5,
2937 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2938 MAV_ODID_HOR_ACC_0_3NM = 6,
2939 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2940 MAV_ODID_HOR_ACC_0_1NM = 7,
2941 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2942 MAV_ODID_HOR_ACC_0_05NM = 8,
2943 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2944 MAV_ODID_HOR_ACC_30_METER = 9,
2945 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2946 MAV_ODID_HOR_ACC_10_METER = 10,
2947 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2948 MAV_ODID_HOR_ACC_3_METER = 11,
2949 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2950 MAV_ODID_HOR_ACC_1_METER = 12,
2951}
2952impl MavOdidHorAcc {
2953 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2954}
2955impl Default for MavOdidHorAcc {
2956 fn default() -> Self {
2957 Self::DEFAULT
2958 }
2959}
2960#[cfg_attr(feature = "ts", derive(TS))]
2961#[cfg_attr(feature = "ts", ts(export))]
2962#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2963#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2964#[cfg_attr(feature = "serde", serde(tag = "type"))]
2965#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2966#[repr(u32)]
2967pub enum MavOdidIdType {
2968 #[doc = "No type defined."]
2969 MAV_ODID_ID_TYPE_NONE = 0,
2970 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2971 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2972 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2973 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2974 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2975 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2976 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2977 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2978}
2979impl MavOdidIdType {
2980 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2981}
2982impl Default for MavOdidIdType {
2983 fn default() -> Self {
2984 Self::DEFAULT
2985 }
2986}
2987#[cfg_attr(feature = "ts", derive(TS))]
2988#[cfg_attr(feature = "ts", ts(export))]
2989#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2990#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2991#[cfg_attr(feature = "serde", serde(tag = "type"))]
2992#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2993#[repr(u32)]
2994pub enum MavOdidOperatorIdType {
2995 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2996 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2997}
2998impl MavOdidOperatorIdType {
2999 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
3000}
3001impl Default for MavOdidOperatorIdType {
3002 fn default() -> Self {
3003 Self::DEFAULT
3004 }
3005}
3006#[cfg_attr(feature = "ts", derive(TS))]
3007#[cfg_attr(feature = "ts", ts(export))]
3008#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3009#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3010#[cfg_attr(feature = "serde", serde(tag = "type"))]
3011#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3012#[repr(u32)]
3013pub enum MavOdidOperatorLocationType {
3014 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3015 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3016 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3017 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3018 #[doc = "The location/altitude of the operator are fixed values."]
3019 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3020}
3021impl MavOdidOperatorLocationType {
3022 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3023}
3024impl Default for MavOdidOperatorLocationType {
3025 fn default() -> Self {
3026 Self::DEFAULT
3027 }
3028}
3029#[cfg_attr(feature = "ts", derive(TS))]
3030#[cfg_attr(feature = "ts", ts(export))]
3031#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3033#[cfg_attr(feature = "serde", serde(tag = "type"))]
3034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3035#[repr(u32)]
3036pub enum MavOdidSpeedAcc {
3037 #[doc = "The speed accuracy is unknown."]
3038 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3039 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3040 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3041 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3042 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3043 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3044 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3045 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3046 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3047}
3048impl MavOdidSpeedAcc {
3049 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3050}
3051impl Default for MavOdidSpeedAcc {
3052 fn default() -> Self {
3053 Self::DEFAULT
3054 }
3055}
3056#[cfg_attr(feature = "ts", derive(TS))]
3057#[cfg_attr(feature = "ts", ts(export))]
3058#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3060#[cfg_attr(feature = "serde", serde(tag = "type"))]
3061#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3062#[repr(u32)]
3063pub enum MavOdidStatus {
3064 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3065 MAV_ODID_STATUS_UNDECLARED = 0,
3066 #[doc = "The UA is on the ground."]
3067 MAV_ODID_STATUS_GROUND = 1,
3068 #[doc = "The UA is in the air."]
3069 MAV_ODID_STATUS_AIRBORNE = 2,
3070 #[doc = "The UA is having an emergency."]
3071 MAV_ODID_STATUS_EMERGENCY = 3,
3072 #[doc = "The remote ID system is failing or unreliable in some way."]
3073 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3074}
3075impl MavOdidStatus {
3076 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3077}
3078impl Default for MavOdidStatus {
3079 fn default() -> Self {
3080 Self::DEFAULT
3081 }
3082}
3083#[cfg_attr(feature = "ts", derive(TS))]
3084#[cfg_attr(feature = "ts", ts(export))]
3085#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3087#[cfg_attr(feature = "serde", serde(tag = "type"))]
3088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3089#[repr(u32)]
3090pub enum MavOdidTimeAcc {
3091 #[doc = "The timestamp accuracy is unknown."]
3092 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3093 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3094 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3095 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3096 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3097 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3098 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3099 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3100 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3101 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3102 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3103 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3104 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3105 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3106 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3107 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3108 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3109 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3110 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3111 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3112 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3113 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3114 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3115 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3116 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3117 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3118 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3119 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3120 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3121 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3122 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3123}
3124impl MavOdidTimeAcc {
3125 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3126}
3127impl Default for MavOdidTimeAcc {
3128 fn default() -> Self {
3129 Self::DEFAULT
3130 }
3131}
3132#[cfg_attr(feature = "ts", derive(TS))]
3133#[cfg_attr(feature = "ts", ts(export))]
3134#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3135#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3136#[cfg_attr(feature = "serde", serde(tag = "type"))]
3137#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3138#[repr(u32)]
3139pub enum MavOdidUaType {
3140 #[doc = "No UA (Unmanned Aircraft) type defined."]
3141 MAV_ODID_UA_TYPE_NONE = 0,
3142 #[doc = "Aeroplane/Airplane. Fixed wing."]
3143 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3144 #[doc = "Helicopter or multirotor."]
3145 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3146 #[doc = "Gyroplane."]
3147 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3148 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3149 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3150 #[doc = "Ornithopter."]
3151 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3152 #[doc = "Glider."]
3153 MAV_ODID_UA_TYPE_GLIDER = 6,
3154 #[doc = "Kite."]
3155 MAV_ODID_UA_TYPE_KITE = 7,
3156 #[doc = "Free Balloon."]
3157 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3158 #[doc = "Captive Balloon."]
3159 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3160 #[doc = "Airship. E.g. a blimp."]
3161 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3162 #[doc = "Free Fall/Parachute (unpowered)."]
3163 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3164 #[doc = "Rocket."]
3165 MAV_ODID_UA_TYPE_ROCKET = 12,
3166 #[doc = "Tethered powered aircraft."]
3167 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3168 #[doc = "Ground Obstacle."]
3169 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3170 #[doc = "Other type of aircraft not listed earlier."]
3171 MAV_ODID_UA_TYPE_OTHER = 15,
3172}
3173impl MavOdidUaType {
3174 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3175}
3176impl Default for MavOdidUaType {
3177 fn default() -> Self {
3178 Self::DEFAULT
3179 }
3180}
3181#[cfg_attr(feature = "ts", derive(TS))]
3182#[cfg_attr(feature = "ts", ts(export))]
3183#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3184#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3185#[cfg_attr(feature = "serde", serde(tag = "type"))]
3186#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3187#[repr(u32)]
3188pub enum MavOdidVerAcc {
3189 #[doc = "The vertical accuracy is unknown."]
3190 MAV_ODID_VER_ACC_UNKNOWN = 0,
3191 #[doc = "The vertical accuracy is smaller than 150 meter."]
3192 MAV_ODID_VER_ACC_150_METER = 1,
3193 #[doc = "The vertical accuracy is smaller than 45 meter."]
3194 MAV_ODID_VER_ACC_45_METER = 2,
3195 #[doc = "The vertical accuracy is smaller than 25 meter."]
3196 MAV_ODID_VER_ACC_25_METER = 3,
3197 #[doc = "The vertical accuracy is smaller than 10 meter."]
3198 MAV_ODID_VER_ACC_10_METER = 4,
3199 #[doc = "The vertical accuracy is smaller than 3 meter."]
3200 MAV_ODID_VER_ACC_3_METER = 5,
3201 #[doc = "The vertical accuracy is smaller than 1 meter."]
3202 MAV_ODID_VER_ACC_1_METER = 6,
3203}
3204impl MavOdidVerAcc {
3205 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3206}
3207impl Default for MavOdidVerAcc {
3208 fn default() -> Self {
3209 Self::DEFAULT
3210 }
3211}
3212#[cfg_attr(feature = "ts", derive(TS))]
3213#[cfg_attr(feature = "ts", ts(export))]
3214#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3216#[cfg_attr(feature = "serde", serde(tag = "type"))]
3217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3218#[repr(u32)]
3219#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3220pub enum MavParamExtType {
3221 #[doc = "8-bit unsigned integer"]
3222 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3223 #[doc = "8-bit signed integer"]
3224 MAV_PARAM_EXT_TYPE_INT8 = 2,
3225 #[doc = "16-bit unsigned integer"]
3226 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3227 #[doc = "16-bit signed integer"]
3228 MAV_PARAM_EXT_TYPE_INT16 = 4,
3229 #[doc = "32-bit unsigned integer"]
3230 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3231 #[doc = "32-bit signed integer"]
3232 MAV_PARAM_EXT_TYPE_INT32 = 6,
3233 #[doc = "64-bit unsigned integer"]
3234 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3235 #[doc = "64-bit signed integer"]
3236 MAV_PARAM_EXT_TYPE_INT64 = 8,
3237 #[doc = "32-bit floating-point"]
3238 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3239 #[doc = "64-bit floating-point"]
3240 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3241 #[doc = "Custom Type"]
3242 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3243}
3244impl MavParamExtType {
3245 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3246}
3247impl Default for MavParamExtType {
3248 fn default() -> Self {
3249 Self::DEFAULT
3250 }
3251}
3252#[cfg_attr(feature = "ts", derive(TS))]
3253#[cfg_attr(feature = "ts", ts(export))]
3254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3256#[cfg_attr(feature = "serde", serde(tag = "type"))]
3257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3258#[repr(u32)]
3259#[doc = "Specifies the datatype of a MAVLink parameter."]
3260pub enum MavParamType {
3261 #[doc = "8-bit unsigned integer"]
3262 MAV_PARAM_TYPE_UINT8 = 1,
3263 #[doc = "8-bit signed integer"]
3264 MAV_PARAM_TYPE_INT8 = 2,
3265 #[doc = "16-bit unsigned integer"]
3266 MAV_PARAM_TYPE_UINT16 = 3,
3267 #[doc = "16-bit signed integer"]
3268 MAV_PARAM_TYPE_INT16 = 4,
3269 #[doc = "32-bit unsigned integer"]
3270 MAV_PARAM_TYPE_UINT32 = 5,
3271 #[doc = "32-bit signed integer"]
3272 MAV_PARAM_TYPE_INT32 = 6,
3273 #[doc = "64-bit unsigned integer"]
3274 MAV_PARAM_TYPE_UINT64 = 7,
3275 #[doc = "64-bit signed integer"]
3276 MAV_PARAM_TYPE_INT64 = 8,
3277 #[doc = "32-bit floating-point"]
3278 MAV_PARAM_TYPE_REAL32 = 9,
3279 #[doc = "64-bit floating-point"]
3280 MAV_PARAM_TYPE_REAL64 = 10,
3281}
3282impl MavParamType {
3283 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3284}
3285impl Default for MavParamType {
3286 fn default() -> Self {
3287 Self::DEFAULT
3288 }
3289}
3290bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3291impl MavPowerStatus {
3292 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3293}
3294impl Default for MavPowerStatus {
3295 fn default() -> Self {
3296 Self::DEFAULT
3297 }
3298}
3299#[cfg_attr(feature = "ts", derive(TS))]
3300#[cfg_attr(feature = "ts", ts(export))]
3301#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3303#[cfg_attr(feature = "serde", serde(tag = "type"))]
3304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3305#[repr(u32)]
3306#[doc = "Action required when performing CMD_PREFLIGHT_STORAGE"]
3307pub enum MavPreflightStorageAction {
3308 #[doc = "Read all parameters from storage"]
3309 MAV_PFS_CMD_READ_ALL = 0,
3310 #[doc = "Write all parameters to storage"]
3311 MAV_PFS_CMD_WRITE_ALL = 1,
3312 #[doc = "Clear all parameters in storage"]
3313 MAV_PFS_CMD_CLEAR_ALL = 2,
3314 #[doc = "Read specific parameters from storage"]
3315 MAV_PFS_CMD_READ_SPECIFIC = 3,
3316 #[doc = "Write specific parameters to storage"]
3317 MAV_PFS_CMD_WRITE_SPECIFIC = 4,
3318 #[doc = "Clear specific parameters in storage"]
3319 MAV_PFS_CMD_CLEAR_SPECIFIC = 5,
3320 #[doc = "do nothing"]
3321 MAV_PFS_CMD_DO_NOTHING = 6,
3322}
3323impl MavPreflightStorageAction {
3324 pub const DEFAULT: Self = Self::MAV_PFS_CMD_READ_ALL;
3325}
3326impl Default for MavPreflightStorageAction {
3327 fn default() -> Self {
3328 Self::DEFAULT
3329 }
3330}
3331bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3332impl MavProtocolCapability {
3333 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3334}
3335impl Default for MavProtocolCapability {
3336 fn default() -> Self {
3337 Self::DEFAULT
3338 }
3339}
3340#[cfg_attr(feature = "ts", derive(TS))]
3341#[cfg_attr(feature = "ts", ts(export))]
3342#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3343#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3344#[cfg_attr(feature = "serde", serde(tag = "type"))]
3345#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3346#[repr(u32)]
3347#[doc = "Result from a MAVLink command (MAV_CMD)"]
3348pub enum MavResult {
3349 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3350 MAV_RESULT_ACCEPTED = 0,
3351 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3352 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3353 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3354 MAV_RESULT_DENIED = 2,
3355 #[doc = "Command is not supported (unknown)."]
3356 MAV_RESULT_UNSUPPORTED = 3,
3357 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3358 MAV_RESULT_FAILED = 4,
3359 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3360 MAV_RESULT_IN_PROGRESS = 5,
3361 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3362 MAV_RESULT_CANCELLED = 6,
3363 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3364 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3365 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3366 MAV_RESULT_COMMAND_INT_ONLY = 8,
3367 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3368 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3369}
3370impl MavResult {
3371 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3372}
3373impl Default for MavResult {
3374 fn default() -> Self {
3375 Self::DEFAULT
3376 }
3377}
3378#[cfg_attr(feature = "ts", derive(TS))]
3379#[cfg_attr(feature = "ts", ts(export))]
3380#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3381#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3382#[cfg_attr(feature = "serde", serde(tag = "type"))]
3383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3384#[repr(u32)]
3385#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3386#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3387pub enum MavRoi {
3388 #[doc = "No region of interest."]
3389 MAV_ROI_NONE = 0,
3390 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3391 MAV_ROI_WPNEXT = 1,
3392 #[doc = "Point toward given waypoint."]
3393 MAV_ROI_WPINDEX = 2,
3394 #[doc = "Point toward fixed location."]
3395 MAV_ROI_LOCATION = 3,
3396 #[doc = "Point toward of given id."]
3397 MAV_ROI_TARGET = 4,
3398}
3399impl MavRoi {
3400 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3401}
3402impl Default for MavRoi {
3403 fn default() -> Self {
3404 Self::DEFAULT
3405 }
3406}
3407#[cfg_attr(feature = "ts", derive(TS))]
3408#[cfg_attr(feature = "ts", ts(export))]
3409#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3410#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3411#[cfg_attr(feature = "serde", serde(tag = "type"))]
3412#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3413#[repr(u32)]
3414#[doc = "Enumeration of sensor orientation, according to its rotations"]
3415pub enum MavSensorOrientation {
3416 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3417 MAV_SENSOR_ROTATION_NONE = 0,
3418 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3419 MAV_SENSOR_ROTATION_YAW_45 = 1,
3420 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3421 MAV_SENSOR_ROTATION_YAW_90 = 2,
3422 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3423 MAV_SENSOR_ROTATION_YAW_135 = 3,
3424 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3425 MAV_SENSOR_ROTATION_YAW_180 = 4,
3426 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3427 MAV_SENSOR_ROTATION_YAW_225 = 5,
3428 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3429 MAV_SENSOR_ROTATION_YAW_270 = 6,
3430 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3431 MAV_SENSOR_ROTATION_YAW_315 = 7,
3432 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3433 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3434 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3435 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3436 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3437 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3438 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3439 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3440 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3441 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3442 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3443 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3444 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3445 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3446 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3447 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3448 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3449 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3450 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3451 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3452 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3453 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3454 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3455 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3456 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3457 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3458 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3459 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3460 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3461 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3462 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3463 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3464 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3465 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3466 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3467 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3468 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3469 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3470 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3471 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3472 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3473 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3474 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3475 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3476 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3477 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3478 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3479 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3480 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3481 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3482 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3483 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3484 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3485 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3486 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3487 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3488 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3489 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3490 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3491 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3492 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3493 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3494 #[doc = "Pitch: 315"]
3495 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3496 #[doc = "Roll: 90, Pitch: 315"]
3497 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3498 #[doc = "Custom orientation"]
3499 MAV_SENSOR_ROTATION_CUSTOM = 100,
3500}
3501impl MavSensorOrientation {
3502 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3503}
3504impl Default for MavSensorOrientation {
3505 fn default() -> Self {
3506 Self::DEFAULT
3507 }
3508}
3509#[cfg_attr(feature = "ts", derive(TS))]
3510#[cfg_attr(feature = "ts", ts(export))]
3511#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3513#[cfg_attr(feature = "serde", serde(tag = "type"))]
3514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3515#[repr(u32)]
3516#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3517pub enum MavSeverity {
3518 #[doc = "System is unusable. This is a \"panic\" condition."]
3519 MAV_SEVERITY_EMERGENCY = 0,
3520 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3521 MAV_SEVERITY_ALERT = 1,
3522 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3523 MAV_SEVERITY_CRITICAL = 2,
3524 #[doc = "Indicates an error in secondary/redundant systems."]
3525 MAV_SEVERITY_ERROR = 3,
3526 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3527 MAV_SEVERITY_WARNING = 4,
3528 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3529 MAV_SEVERITY_NOTICE = 5,
3530 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3531 MAV_SEVERITY_INFO = 6,
3532 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3533 MAV_SEVERITY_DEBUG = 7,
3534}
3535impl MavSeverity {
3536 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3537}
3538impl Default for MavSeverity {
3539 fn default() -> Self {
3540 Self::DEFAULT
3541 }
3542}
3543#[cfg_attr(feature = "ts", derive(TS))]
3544#[cfg_attr(feature = "ts", ts(export))]
3545#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3547#[cfg_attr(feature = "serde", serde(tag = "type"))]
3548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3549#[repr(u32)]
3550#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3551pub enum MavStandardMode {
3552 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3553 MAV_STANDARD_MODE_NON_STANDARD = 0,
3554 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3555 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3556 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3557 MAV_STANDARD_MODE_ORBIT = 2,
3558 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3559 MAV_STANDARD_MODE_CRUISE = 3,
3560 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3561 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3562 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3563 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3564 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3565 MAV_STANDARD_MODE_MISSION = 6,
3566 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3567 MAV_STANDARD_MODE_LAND = 7,
3568 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3569 MAV_STANDARD_MODE_TAKEOFF = 8,
3570}
3571impl MavStandardMode {
3572 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3573}
3574impl Default for MavStandardMode {
3575 fn default() -> Self {
3576 Self::DEFAULT
3577 }
3578}
3579#[cfg_attr(feature = "ts", derive(TS))]
3580#[cfg_attr(feature = "ts", ts(export))]
3581#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3582#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3583#[cfg_attr(feature = "serde", serde(tag = "type"))]
3584#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3585#[repr(u32)]
3586pub enum MavState {
3587 #[doc = "Uninitialized system, state is unknown."]
3588 MAV_STATE_UNINIT = 0,
3589 #[doc = "System is booting up."]
3590 MAV_STATE_BOOT = 1,
3591 #[doc = "System is calibrating and not flight-ready."]
3592 MAV_STATE_CALIBRATING = 2,
3593 #[doc = "System is grounded and on standby. It can be launched any time."]
3594 MAV_STATE_STANDBY = 3,
3595 #[doc = "System is active and might be already airborne. Motors are engaged."]
3596 MAV_STATE_ACTIVE = 4,
3597 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3598 MAV_STATE_CRITICAL = 5,
3599 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3600 MAV_STATE_EMERGENCY = 6,
3601 #[doc = "System just initialized its power-down sequence, will shut down now."]
3602 MAV_STATE_POWEROFF = 7,
3603 #[doc = "System is terminating itself (failsafe or commanded)."]
3604 MAV_STATE_FLIGHT_TERMINATION = 8,
3605}
3606impl MavState {
3607 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3608}
3609impl Default for MavState {
3610 fn default() -> Self {
3611 Self::DEFAULT
3612 }
3613}
3614bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3615impl MavSysStatusSensor {
3616 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3617}
3618impl Default for MavSysStatusSensor {
3619 fn default() -> Self {
3620 Self::DEFAULT
3621 }
3622}
3623bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3624impl MavSysStatusSensorExtended {
3625 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3626}
3627impl Default for MavSysStatusSensorExtended {
3628 fn default() -> Self {
3629 Self::DEFAULT
3630 }
3631}
3632#[cfg_attr(feature = "ts", derive(TS))]
3633#[cfg_attr(feature = "ts", ts(export))]
3634#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3635#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3636#[cfg_attr(feature = "serde", serde(tag = "type"))]
3637#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3638#[repr(u32)]
3639pub enum MavTunnelPayloadType {
3640 #[doc = "Encoding of payload unknown."]
3641 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3642 #[doc = "Registered for STorM32 gimbal controller."]
3643 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3644 #[doc = "Registered for STorM32 gimbal controller."]
3645 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3646 #[doc = "Registered for STorM32 gimbal controller."]
3647 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3648 #[doc = "Registered for STorM32 gimbal controller."]
3649 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3650 #[doc = "Registered for STorM32 gimbal controller."]
3651 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3652 #[doc = "Registered for STorM32 gimbal controller."]
3653 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3654 #[doc = "Registered for STorM32 gimbal controller."]
3655 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3656 #[doc = "Registered for STorM32 gimbal controller."]
3657 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3658 #[doc = "Registered for STorM32 gimbal controller."]
3659 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3660 #[doc = "Registered for STorM32 gimbal controller."]
3661 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3662 #[doc = "Registered for ModalAI remote OSD protocol."]
3663 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3664 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3665 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3666 #[doc = "Registered for ModalAI vendor use."]
3667 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3668}
3669impl MavTunnelPayloadType {
3670 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3671}
3672impl Default for MavTunnelPayloadType {
3673 fn default() -> Self {
3674 Self::DEFAULT
3675 }
3676}
3677#[cfg_attr(feature = "ts", derive(TS))]
3678#[cfg_attr(feature = "ts", ts(export))]
3679#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3681#[cfg_attr(feature = "serde", serde(tag = "type"))]
3682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3683#[repr(u32)]
3684#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3685pub enum MavType {
3686 #[doc = "Generic micro air vehicle"]
3687 MAV_TYPE_GENERIC = 0,
3688 #[doc = "Fixed wing aircraft."]
3689 MAV_TYPE_FIXED_WING = 1,
3690 #[doc = "Quadrotor"]
3691 MAV_TYPE_QUADROTOR = 2,
3692 #[doc = "Coaxial helicopter"]
3693 MAV_TYPE_COAXIAL = 3,
3694 #[doc = "Normal helicopter with tail rotor."]
3695 MAV_TYPE_HELICOPTER = 4,
3696 #[doc = "Ground installation"]
3697 MAV_TYPE_ANTENNA_TRACKER = 5,
3698 #[doc = "Operator control unit / ground control station"]
3699 MAV_TYPE_GCS = 6,
3700 #[doc = "Airship, controlled"]
3701 MAV_TYPE_AIRSHIP = 7,
3702 #[doc = "Free balloon, uncontrolled"]
3703 MAV_TYPE_FREE_BALLOON = 8,
3704 #[doc = "Rocket"]
3705 MAV_TYPE_ROCKET = 9,
3706 #[doc = "Ground rover"]
3707 MAV_TYPE_GROUND_ROVER = 10,
3708 #[doc = "Surface vessel, boat, ship"]
3709 MAV_TYPE_SURFACE_BOAT = 11,
3710 #[doc = "Submarine"]
3711 MAV_TYPE_SUBMARINE = 12,
3712 #[doc = "Hexarotor"]
3713 MAV_TYPE_HEXAROTOR = 13,
3714 #[doc = "Octorotor"]
3715 MAV_TYPE_OCTOROTOR = 14,
3716 #[doc = "Tricopter"]
3717 MAV_TYPE_TRICOPTER = 15,
3718 #[doc = "Flapping wing"]
3719 MAV_TYPE_FLAPPING_WING = 16,
3720 #[doc = "Kite"]
3721 MAV_TYPE_KITE = 17,
3722 #[doc = "Onboard companion controller"]
3723 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3724 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3725 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3726 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3727 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3728 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3729 MAV_TYPE_VTOL_TILTROTOR = 21,
3730 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3731 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3732 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3733 MAV_TYPE_VTOL_TAILSITTER = 23,
3734 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3735 MAV_TYPE_VTOL_TILTWING = 24,
3736 #[doc = "VTOL reserved 5"]
3737 MAV_TYPE_VTOL_RESERVED5 = 25,
3738 #[doc = "Gimbal"]
3739 MAV_TYPE_GIMBAL = 26,
3740 #[doc = "ADSB system"]
3741 MAV_TYPE_ADSB = 27,
3742 #[doc = "Steerable, nonrigid airfoil"]
3743 MAV_TYPE_PARAFOIL = 28,
3744 #[doc = "Dodecarotor"]
3745 MAV_TYPE_DODECAROTOR = 29,
3746 #[doc = "Camera"]
3747 MAV_TYPE_CAMERA = 30,
3748 #[doc = "Charging station"]
3749 MAV_TYPE_CHARGING_STATION = 31,
3750 #[doc = "FLARM collision avoidance system"]
3751 MAV_TYPE_FLARM = 32,
3752 #[doc = "Servo"]
3753 MAV_TYPE_SERVO = 33,
3754 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3755 MAV_TYPE_ODID = 34,
3756 #[doc = "Decarotor"]
3757 MAV_TYPE_DECAROTOR = 35,
3758 #[doc = "Battery"]
3759 MAV_TYPE_BATTERY = 36,
3760 #[doc = "Parachute"]
3761 MAV_TYPE_PARACHUTE = 37,
3762 #[doc = "Log"]
3763 MAV_TYPE_LOG = 38,
3764 #[doc = "OSD"]
3765 MAV_TYPE_OSD = 39,
3766 #[doc = "IMU"]
3767 MAV_TYPE_IMU = 40,
3768 #[doc = "GPS"]
3769 MAV_TYPE_GPS = 41,
3770 #[doc = "Winch"]
3771 MAV_TYPE_WINCH = 42,
3772 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3773 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3774 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3775 MAV_TYPE_ILLUMINATOR = 44,
3776 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3777 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3778}
3779impl MavType {
3780 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3781}
3782impl Default for MavType {
3783 fn default() -> Self {
3784 Self::DEFAULT
3785 }
3786}
3787#[cfg_attr(feature = "ts", derive(TS))]
3788#[cfg_attr(feature = "ts", ts(export))]
3789#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3790#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3791#[cfg_attr(feature = "serde", serde(tag = "type"))]
3792#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3793#[repr(u32)]
3794#[doc = "Enumeration of VTOL states"]
3795pub enum MavVtolState {
3796 #[doc = "MAV is not configured as VTOL"]
3797 MAV_VTOL_STATE_UNDEFINED = 0,
3798 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3799 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3800 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3801 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3802 #[doc = "VTOL is in multicopter state"]
3803 MAV_VTOL_STATE_MC = 3,
3804 #[doc = "VTOL is in fixed-wing state"]
3805 MAV_VTOL_STATE_FW = 4,
3806}
3807impl MavVtolState {
3808 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3809}
3810impl Default for MavVtolState {
3811 fn default() -> Self {
3812 Self::DEFAULT
3813 }
3814}
3815bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3816impl MavWinchStatusFlag {
3817 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3818}
3819impl Default for MavWinchStatusFlag {
3820 fn default() -> Self {
3821 Self::DEFAULT
3822 }
3823}
3824#[cfg_attr(feature = "ts", derive(TS))]
3825#[cfg_attr(feature = "ts", ts(export))]
3826#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3827#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3828#[cfg_attr(feature = "serde", serde(tag = "type"))]
3829#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3830#[repr(u32)]
3831pub enum MavlinkDataStreamType {
3832 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3833 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3834 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3835 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3836 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3837 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3838}
3839impl MavlinkDataStreamType {
3840 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3841}
3842impl Default for MavlinkDataStreamType {
3843 fn default() -> Self {
3844 Self::DEFAULT
3845 }
3846}
3847#[cfg_attr(feature = "ts", derive(TS))]
3848#[cfg_attr(feature = "ts", ts(export))]
3849#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3850#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3851#[cfg_attr(feature = "serde", serde(tag = "type"))]
3852#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3853#[repr(u32)]
3854#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3855pub enum MissionState {
3856 #[doc = "The mission status reporting is not supported."]
3857 MISSION_STATE_UNKNOWN = 0,
3858 #[doc = "No mission on the vehicle."]
3859 MISSION_STATE_NO_MISSION = 1,
3860 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3861 MISSION_STATE_NOT_STARTED = 2,
3862 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3863 MISSION_STATE_ACTIVE = 3,
3864 #[doc = "Mission is paused when in auto mode."]
3865 MISSION_STATE_PAUSED = 4,
3866 #[doc = "Mission has executed all mission items."]
3867 MISSION_STATE_COMPLETE = 5,
3868}
3869impl MissionState {
3870 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3871}
3872impl Default for MissionState {
3873 fn default() -> Self {
3874 Self::DEFAULT
3875 }
3876}
3877#[cfg_attr(feature = "ts", derive(TS))]
3878#[cfg_attr(feature = "ts", ts(export))]
3879#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3881#[cfg_attr(feature = "serde", serde(tag = "type"))]
3882#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3883#[repr(u32)]
3884#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3885pub enum MotorTestOrder {
3886 #[doc = "Default autopilot motor test method."]
3887 MOTOR_TEST_ORDER_DEFAULT = 0,
3888 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3889 MOTOR_TEST_ORDER_SEQUENCE = 1,
3890 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3891 MOTOR_TEST_ORDER_BOARD = 2,
3892}
3893impl MotorTestOrder {
3894 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3895}
3896impl Default for MotorTestOrder {
3897 fn default() -> Self {
3898 Self::DEFAULT
3899 }
3900}
3901#[cfg_attr(feature = "ts", derive(TS))]
3902#[cfg_attr(feature = "ts", ts(export))]
3903#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3904#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3905#[cfg_attr(feature = "serde", serde(tag = "type"))]
3906#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3907#[repr(u32)]
3908#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3909pub enum MotorTestThrottleType {
3910 #[doc = "Throttle as a percentage (0 ~ 100)"]
3911 MOTOR_TEST_THROTTLE_PERCENT = 0,
3912 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3913 MOTOR_TEST_THROTTLE_PWM = 1,
3914 #[doc = "Throttle pass-through from pilot's transmitter."]
3915 MOTOR_TEST_THROTTLE_PILOT = 2,
3916 #[doc = "Per-motor compass calibration test."]
3917 MOTOR_TEST_COMPASS_CAL = 3,
3918}
3919impl MotorTestThrottleType {
3920 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3921}
3922impl Default for MotorTestThrottleType {
3923 fn default() -> Self {
3924 Self::DEFAULT
3925 }
3926}
3927#[cfg_attr(feature = "ts", derive(TS))]
3928#[cfg_attr(feature = "ts", ts(export))]
3929#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3931#[cfg_attr(feature = "serde", serde(tag = "type"))]
3932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3933#[repr(u32)]
3934pub enum NavVtolLandOptions {
3935 #[doc = "Default autopilot landing behaviour."]
3936 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3937 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3938 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3939 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3940 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3941}
3942impl NavVtolLandOptions {
3943 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3944}
3945impl Default for NavVtolLandOptions {
3946 fn default() -> Self {
3947 Self::DEFAULT
3948 }
3949}
3950#[cfg_attr(feature = "ts", derive(TS))]
3951#[cfg_attr(feature = "ts", ts(export))]
3952#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3953#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3954#[cfg_attr(feature = "serde", serde(tag = "type"))]
3955#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3956#[repr(u32)]
3957#[doc = "Yaw behaviour during orbit flight."]
3958pub enum OrbitYawBehaviour {
3959 #[doc = "Vehicle front points to the center (default)."]
3960 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3961 #[doc = "Vehicle front holds heading when message received."]
3962 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3963 #[doc = "Yaw uncontrolled."]
3964 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3965 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3966 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3967 #[doc = "Yaw controlled by RC input."]
3968 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3969 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3970 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3971}
3972impl OrbitYawBehaviour {
3973 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3974}
3975impl Default for OrbitYawBehaviour {
3976 fn default() -> Self {
3977 Self::DEFAULT
3978 }
3979}
3980#[cfg_attr(feature = "ts", derive(TS))]
3981#[cfg_attr(feature = "ts", ts(export))]
3982#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3983#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3984#[cfg_attr(feature = "serde", serde(tag = "type"))]
3985#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3986#[repr(u32)]
3987#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3988pub enum ParachuteAction {
3989 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3990 PARACHUTE_DISABLE = 0,
3991 #[doc = "Enable auto-release of parachute."]
3992 PARACHUTE_ENABLE = 1,
3993 #[doc = "Release parachute and kill motors."]
3994 PARACHUTE_RELEASE = 2,
3995}
3996impl ParachuteAction {
3997 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3998}
3999impl Default for ParachuteAction {
4000 fn default() -> Self {
4001 Self::DEFAULT
4002 }
4003}
4004#[cfg_attr(feature = "ts", derive(TS))]
4005#[cfg_attr(feature = "ts", ts(export))]
4006#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4008#[cfg_attr(feature = "serde", serde(tag = "type"))]
4009#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4010#[repr(u32)]
4011#[doc = "Result from PARAM_EXT_SET message."]
4012pub enum ParamAck {
4013 #[doc = "Parameter value ACCEPTED and SET"]
4014 PARAM_ACK_ACCEPTED = 0,
4015 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
4016 PARAM_ACK_VALUE_UNSUPPORTED = 1,
4017 #[doc = "Parameter failed to set"]
4018 PARAM_ACK_FAILED = 2,
4019 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
4020 PARAM_ACK_IN_PROGRESS = 3,
4021}
4022impl ParamAck {
4023 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
4024}
4025impl Default for ParamAck {
4026 fn default() -> Self {
4027 Self::DEFAULT
4028 }
4029}
4030bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
4031impl PositionTargetTypemask {
4032 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
4033}
4034impl Default for PositionTargetTypemask {
4035 fn default() -> Self {
4036 Self::DEFAULT
4037 }
4038}
4039#[cfg_attr(feature = "ts", derive(TS))]
4040#[cfg_attr(feature = "ts", ts(export))]
4041#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4043#[cfg_attr(feature = "serde", serde(tag = "type"))]
4044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4045#[repr(u32)]
4046#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
4047pub enum PrecisionLandMode {
4048 #[doc = "Normal (non-precision) landing."]
4049 PRECISION_LAND_MODE_DISABLED = 0,
4050 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
4051 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
4052 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
4053 PRECISION_LAND_MODE_REQUIRED = 2,
4054}
4055impl PrecisionLandMode {
4056 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
4057}
4058impl Default for PrecisionLandMode {
4059 fn default() -> Self {
4060 Self::DEFAULT
4061 }
4062}
4063#[cfg_attr(feature = "ts", derive(TS))]
4064#[cfg_attr(feature = "ts", ts(export))]
4065#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4066#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4067#[cfg_attr(feature = "serde", serde(tag = "type"))]
4068#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4069#[repr(u32)]
4070#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4071pub enum PreflightStorageMissionAction {
4072 #[doc = "Read current mission data from persistent storage"]
4073 MISSION_READ_PERSISTENT = 0,
4074 #[doc = "Write current mission data to persistent storage"]
4075 MISSION_WRITE_PERSISTENT = 1,
4076 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
4077 MISSION_RESET_DEFAULT = 2,
4078}
4079impl PreflightStorageMissionAction {
4080 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
4081}
4082impl Default for PreflightStorageMissionAction {
4083 fn default() -> Self {
4084 Self::DEFAULT
4085 }
4086}
4087#[cfg_attr(feature = "ts", derive(TS))]
4088#[cfg_attr(feature = "ts", ts(export))]
4089#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4090#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4091#[cfg_attr(feature = "serde", serde(tag = "type"))]
4092#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4093#[repr(u32)]
4094#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4095pub enum PreflightStorageParameterAction {
4096 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4097 PARAM_READ_PERSISTENT = 0,
4098 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4099 PARAM_WRITE_PERSISTENT = 1,
4100 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4101 PARAM_RESET_CONFIG_DEFAULT = 2,
4102 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4103 PARAM_RESET_SENSOR_DEFAULT = 3,
4104 #[doc = "Reset all parameters, including operation counters, to default values"]
4105 PARAM_RESET_ALL_DEFAULT = 4,
4106}
4107impl PreflightStorageParameterAction {
4108 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4109}
4110impl Default for PreflightStorageParameterAction {
4111 fn default() -> Self {
4112 Self::DEFAULT
4113 }
4114}
4115#[cfg_attr(feature = "ts", derive(TS))]
4116#[cfg_attr(feature = "ts", ts(export))]
4117#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4118#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4119#[cfg_attr(feature = "serde", serde(tag = "type"))]
4120#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4121#[repr(u32)]
4122#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
4123pub enum RcSubType {
4124 #[doc = "Spektrum DSM2"]
4125 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4126 #[doc = "Spektrum DSMX"]
4127 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4128 #[doc = "Spektrum DSMX8"]
4129 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4130}
4131impl RcSubType {
4132 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4133}
4134impl Default for RcSubType {
4135 fn default() -> Self {
4136 Self::DEFAULT
4137 }
4138}
4139#[cfg_attr(feature = "ts", derive(TS))]
4140#[cfg_attr(feature = "ts", ts(export))]
4141#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4143#[cfg_attr(feature = "serde", serde(tag = "type"))]
4144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4145#[repr(u32)]
4146#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4147pub enum RcType {
4148 #[doc = "Spektrum"]
4149 RC_TYPE_SPEKTRUM = 0,
4150 #[doc = "CRSF"]
4151 RC_TYPE_CRSF = 1,
4152}
4153impl RcType {
4154 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4155}
4156impl Default for RcType {
4157 fn default() -> Self {
4158 Self::DEFAULT
4159 }
4160}
4161#[cfg_attr(feature = "ts", derive(TS))]
4162#[cfg_attr(feature = "ts", ts(export))]
4163#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4164#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4165#[cfg_attr(feature = "serde", serde(tag = "type"))]
4166#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4167#[repr(u32)]
4168#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4169pub enum RebootShutdownConditions {
4170 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4171 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4172 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4173 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4174}
4175impl RebootShutdownConditions {
4176 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4177}
4178impl Default for RebootShutdownConditions {
4179 fn default() -> Self {
4180 Self::DEFAULT
4181 }
4182}
4183#[cfg_attr(feature = "ts", derive(TS))]
4184#[cfg_attr(feature = "ts", ts(export))]
4185#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4186#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4187#[cfg_attr(feature = "serde", serde(tag = "type"))]
4188#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4189#[repr(u32)]
4190#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4191pub enum RtkBaselineCoordinateSystem {
4192 #[doc = "Earth-centered, Earth-fixed"]
4193 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4194 #[doc = "RTK basestation centered, north, east, down"]
4195 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4196}
4197impl RtkBaselineCoordinateSystem {
4198 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4199}
4200impl Default for RtkBaselineCoordinateSystem {
4201 fn default() -> Self {
4202 Self::DEFAULT
4203 }
4204}
4205#[cfg_attr(feature = "ts", derive(TS))]
4206#[cfg_attr(feature = "ts", ts(export))]
4207#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4209#[cfg_attr(feature = "serde", serde(tag = "type"))]
4210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4211#[repr(u32)]
4212#[doc = "Possible safety switch states."]
4213pub enum SafetySwitchState {
4214 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4215 SAFETY_SWITCH_STATE_SAFE = 0,
4216 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4217 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4218}
4219impl SafetySwitchState {
4220 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4221}
4222impl Default for SafetySwitchState {
4223 fn default() -> Self {
4224 Self::DEFAULT
4225 }
4226}
4227#[cfg_attr(feature = "ts", derive(TS))]
4228#[cfg_attr(feature = "ts", ts(export))]
4229#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4230#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4231#[cfg_attr(feature = "serde", serde(tag = "type"))]
4232#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4233#[repr(u32)]
4234#[doc = "SERIAL_CONTROL device types"]
4235pub enum SerialControlDev {
4236 #[doc = "First telemetry port"]
4237 SERIAL_CONTROL_DEV_TELEM1 = 0,
4238 #[doc = "Second telemetry port"]
4239 SERIAL_CONTROL_DEV_TELEM2 = 1,
4240 #[doc = "First GPS port"]
4241 SERIAL_CONTROL_DEV_GPS1 = 2,
4242 #[doc = "Second GPS port"]
4243 SERIAL_CONTROL_DEV_GPS2 = 3,
4244 #[doc = "system shell"]
4245 SERIAL_CONTROL_DEV_SHELL = 10,
4246 #[doc = "SERIAL0"]
4247 SERIAL_CONTROL_SERIAL0 = 100,
4248 #[doc = "SERIAL1"]
4249 SERIAL_CONTROL_SERIAL1 = 101,
4250 #[doc = "SERIAL2"]
4251 SERIAL_CONTROL_SERIAL2 = 102,
4252 #[doc = "SERIAL3"]
4253 SERIAL_CONTROL_SERIAL3 = 103,
4254 #[doc = "SERIAL4"]
4255 SERIAL_CONTROL_SERIAL4 = 104,
4256 #[doc = "SERIAL5"]
4257 SERIAL_CONTROL_SERIAL5 = 105,
4258 #[doc = "SERIAL6"]
4259 SERIAL_CONTROL_SERIAL6 = 106,
4260 #[doc = "SERIAL7"]
4261 SERIAL_CONTROL_SERIAL7 = 107,
4262 #[doc = "SERIAL8"]
4263 SERIAL_CONTROL_SERIAL8 = 108,
4264 #[doc = "SERIAL9"]
4265 SERIAL_CONTROL_SERIAL9 = 109,
4266}
4267impl SerialControlDev {
4268 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4269}
4270impl Default for SerialControlDev {
4271 fn default() -> Self {
4272 Self::DEFAULT
4273 }
4274}
4275bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4276impl SerialControlFlag {
4277 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4278}
4279impl Default for SerialControlFlag {
4280 fn default() -> Self {
4281 Self::DEFAULT
4282 }
4283}
4284#[cfg_attr(feature = "ts", derive(TS))]
4285#[cfg_attr(feature = "ts", ts(export))]
4286#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4287#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4288#[cfg_attr(feature = "serde", serde(tag = "type"))]
4289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4290#[repr(u32)]
4291#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4292pub enum SetFocusType {
4293 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4294 FOCUS_TYPE_STEP = 0,
4295 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4296 FOCUS_TYPE_CONTINUOUS = 1,
4297 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4298 FOCUS_TYPE_RANGE = 2,
4299 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4300 FOCUS_TYPE_METERS = 3,
4301 #[doc = "Focus automatically."]
4302 FOCUS_TYPE_AUTO = 4,
4303 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4304 FOCUS_TYPE_AUTO_SINGLE = 5,
4305 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4306 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4307}
4308impl SetFocusType {
4309 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4310}
4311impl Default for SetFocusType {
4312 fn default() -> Self {
4313 Self::DEFAULT
4314 }
4315}
4316#[cfg_attr(feature = "ts", derive(TS))]
4317#[cfg_attr(feature = "ts", ts(export))]
4318#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4319#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4320#[cfg_attr(feature = "serde", serde(tag = "type"))]
4321#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4322#[repr(u32)]
4323#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4324pub enum SpeedType {
4325 #[doc = "Airspeed"]
4326 SPEED_TYPE_AIRSPEED = 0,
4327 #[doc = "Groundspeed"]
4328 SPEED_TYPE_GROUNDSPEED = 1,
4329 #[doc = "Climb speed"]
4330 SPEED_TYPE_CLIMB_SPEED = 2,
4331 #[doc = "Descent speed"]
4332 SPEED_TYPE_DESCENT_SPEED = 3,
4333}
4334impl SpeedType {
4335 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4336}
4337impl Default for SpeedType {
4338 fn default() -> Self {
4339 Self::DEFAULT
4340 }
4341}
4342#[cfg_attr(feature = "ts", derive(TS))]
4343#[cfg_attr(feature = "ts", ts(export))]
4344#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4345#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4346#[cfg_attr(feature = "serde", serde(tag = "type"))]
4347#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4348#[repr(u32)]
4349#[doc = "Flags to indicate the status of camera storage."]
4350pub enum StorageStatus {
4351 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4352 STORAGE_STATUS_EMPTY = 0,
4353 #[doc = "Storage present but unformatted."]
4354 STORAGE_STATUS_UNFORMATTED = 1,
4355 #[doc = "Storage present and ready."]
4356 STORAGE_STATUS_READY = 2,
4357 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4358 STORAGE_STATUS_NOT_SUPPORTED = 3,
4359}
4360impl StorageStatus {
4361 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4362}
4363impl Default for StorageStatus {
4364 fn default() -> Self {
4365 Self::DEFAULT
4366 }
4367}
4368#[cfg_attr(feature = "ts", derive(TS))]
4369#[cfg_attr(feature = "ts", ts(export))]
4370#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4371#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4372#[cfg_attr(feature = "serde", serde(tag = "type"))]
4373#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4374#[repr(u32)]
4375#[doc = "Flags to indicate the type of storage."]
4376pub enum StorageType {
4377 #[doc = "Storage type is not known."]
4378 STORAGE_TYPE_UNKNOWN = 0,
4379 #[doc = "Storage type is USB device."]
4380 STORAGE_TYPE_USB_STICK = 1,
4381 #[doc = "Storage type is SD card."]
4382 STORAGE_TYPE_SD = 2,
4383 #[doc = "Storage type is microSD card."]
4384 STORAGE_TYPE_MICROSD = 3,
4385 #[doc = "Storage type is CFast."]
4386 STORAGE_TYPE_CF = 4,
4387 #[doc = "Storage type is CFexpress."]
4388 STORAGE_TYPE_CFE = 5,
4389 #[doc = "Storage type is XQD."]
4390 STORAGE_TYPE_XQD = 6,
4391 #[doc = "Storage type is HD mass storage type."]
4392 STORAGE_TYPE_HD = 7,
4393 #[doc = "Storage type is other, not listed type."]
4394 STORAGE_TYPE_OTHER = 254,
4395}
4396impl StorageType {
4397 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4398}
4399impl Default for StorageType {
4400 fn default() -> Self {
4401 Self::DEFAULT
4402 }
4403}
4404bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4405impl StorageUsageFlag {
4406 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4407}
4408impl Default for StorageUsageFlag {
4409 fn default() -> Self {
4410 Self::DEFAULT
4411 }
4412}
4413#[cfg_attr(feature = "ts", derive(TS))]
4414#[cfg_attr(feature = "ts", ts(export))]
4415#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4416#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4417#[cfg_attr(feature = "serde", serde(tag = "type"))]
4418#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4419#[repr(u32)]
4420#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4421pub enum TuneFormat {
4422 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4423 TUNE_FORMAT_QBASIC1_1 = 1,
4424 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4425 TUNE_FORMAT_MML_MODERN = 2,
4426}
4427impl TuneFormat {
4428 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4429}
4430impl Default for TuneFormat {
4431 fn default() -> Self {
4432 Self::DEFAULT
4433 }
4434}
4435#[cfg_attr(feature = "ts", derive(TS))]
4436#[cfg_attr(feature = "ts", ts(export))]
4437#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4438#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4439#[cfg_attr(feature = "serde", serde(tag = "type"))]
4440#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4441#[repr(u32)]
4442#[doc = "Generalized UAVCAN node health"]
4443pub enum UavcanNodeHealth {
4444 #[doc = "The node is functioning properly."]
4445 UAVCAN_NODE_HEALTH_OK = 0,
4446 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4447 UAVCAN_NODE_HEALTH_WARNING = 1,
4448 #[doc = "The node has encountered a major failure."]
4449 UAVCAN_NODE_HEALTH_ERROR = 2,
4450 #[doc = "The node has suffered a fatal malfunction."]
4451 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4452}
4453impl UavcanNodeHealth {
4454 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4455}
4456impl Default for UavcanNodeHealth {
4457 fn default() -> Self {
4458 Self::DEFAULT
4459 }
4460}
4461#[cfg_attr(feature = "ts", derive(TS))]
4462#[cfg_attr(feature = "ts", ts(export))]
4463#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4464#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4465#[cfg_attr(feature = "serde", serde(tag = "type"))]
4466#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4467#[repr(u32)]
4468#[doc = "Generalized UAVCAN node mode"]
4469pub enum UavcanNodeMode {
4470 #[doc = "The node is performing its primary functions."]
4471 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4472 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4473 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4474 #[doc = "The node is under maintenance."]
4475 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4476 #[doc = "The node is in the process of updating its software."]
4477 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4478 #[doc = "The node is no longer available online."]
4479 UAVCAN_NODE_MODE_OFFLINE = 7,
4480}
4481impl UavcanNodeMode {
4482 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4483}
4484impl Default for UavcanNodeMode {
4485 fn default() -> Self {
4486 Self::DEFAULT
4487 }
4488}
4489bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4490impl UtmDataAvailFlags {
4491 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4492}
4493impl Default for UtmDataAvailFlags {
4494 fn default() -> Self {
4495 Self::DEFAULT
4496 }
4497}
4498#[cfg_attr(feature = "ts", derive(TS))]
4499#[cfg_attr(feature = "ts", ts(export))]
4500#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4501#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4502#[cfg_attr(feature = "serde", serde(tag = "type"))]
4503#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4504#[repr(u32)]
4505#[doc = "Airborne status of UAS."]
4506pub enum UtmFlightState {
4507 #[doc = "The flight state can't be determined."]
4508 UTM_FLIGHT_STATE_UNKNOWN = 1,
4509 #[doc = "UAS on ground."]
4510 UTM_FLIGHT_STATE_GROUND = 2,
4511 #[doc = "UAS airborne."]
4512 UTM_FLIGHT_STATE_AIRBORNE = 3,
4513 #[doc = "UAS is in an emergency flight state."]
4514 UTM_FLIGHT_STATE_EMERGENCY = 16,
4515 #[doc = "UAS has no active controls."]
4516 UTM_FLIGHT_STATE_NOCTRL = 32,
4517}
4518impl UtmFlightState {
4519 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4520}
4521impl Default for UtmFlightState {
4522 fn default() -> Self {
4523 Self::DEFAULT
4524 }
4525}
4526#[cfg_attr(feature = "ts", derive(TS))]
4527#[cfg_attr(feature = "ts", ts(export))]
4528#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4529#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4530#[cfg_attr(feature = "serde", serde(tag = "type"))]
4531#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4532#[repr(u32)]
4533#[doc = "Video stream encodings"]
4534pub enum VideoStreamEncoding {
4535 #[doc = "Stream encoding is unknown"]
4536 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4537 #[doc = "Stream encoding is H.264"]
4538 VIDEO_STREAM_ENCODING_H264 = 1,
4539 #[doc = "Stream encoding is H.265"]
4540 VIDEO_STREAM_ENCODING_H265 = 2,
4541}
4542impl VideoStreamEncoding {
4543 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4544}
4545impl Default for VideoStreamEncoding {
4546 fn default() -> Self {
4547 Self::DEFAULT
4548 }
4549}
4550bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4551impl VideoStreamStatusFlags {
4552 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4553}
4554impl Default for VideoStreamStatusFlags {
4555 fn default() -> Self {
4556 Self::DEFAULT
4557 }
4558}
4559#[cfg_attr(feature = "ts", derive(TS))]
4560#[cfg_attr(feature = "ts", ts(export))]
4561#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4562#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4563#[cfg_attr(feature = "serde", serde(tag = "type"))]
4564#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4565#[repr(u32)]
4566#[doc = "Video stream types"]
4567pub enum VideoStreamType {
4568 #[doc = "Stream is RTSP"]
4569 VIDEO_STREAM_TYPE_RTSP = 0,
4570 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4571 VIDEO_STREAM_TYPE_RTPUDP = 1,
4572 #[doc = "Stream is MPEG on TCP"]
4573 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4574 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4575 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4576}
4577impl VideoStreamType {
4578 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4579}
4580impl Default for VideoStreamType {
4581 fn default() -> Self {
4582 Self::DEFAULT
4583 }
4584}
4585#[cfg_attr(feature = "ts", derive(TS))]
4586#[cfg_attr(feature = "ts", ts(export))]
4587#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4588#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4589#[cfg_attr(feature = "serde", serde(tag = "type"))]
4590#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4591#[repr(u32)]
4592#[doc = "Direction of VTOL transition"]
4593pub enum VtolTransitionHeading {
4594 #[doc = "Respect the heading configuration of the vehicle."]
4595 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4596 #[doc = "Use the heading pointing towards the next waypoint."]
4597 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4598 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4599 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4600 #[doc = "Use the specified heading in parameter 4."]
4601 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4602 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4603 VTOL_TRANSITION_HEADING_ANY = 4,
4604}
4605impl VtolTransitionHeading {
4606 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4607}
4608impl Default for VtolTransitionHeading {
4609 fn default() -> Self {
4610 Self::DEFAULT
4611 }
4612}
4613#[cfg_attr(feature = "ts", derive(TS))]
4614#[cfg_attr(feature = "ts", ts(export))]
4615#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4616#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4617#[cfg_attr(feature = "serde", serde(tag = "type"))]
4618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4619#[repr(u32)]
4620#[doc = "WiFi Mode."]
4621pub enum WifiConfigApMode {
4622 #[doc = "WiFi mode is undefined."]
4623 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4624 #[doc = "WiFi configured as an access point."]
4625 WIFI_CONFIG_AP_MODE_AP = 1,
4626 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4627 WIFI_CONFIG_AP_MODE_STATION = 2,
4628 #[doc = "WiFi disabled."]
4629 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4630}
4631impl WifiConfigApMode {
4632 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4633}
4634impl Default for WifiConfigApMode {
4635 fn default() -> Self {
4636 Self::DEFAULT
4637 }
4638}
4639#[cfg_attr(feature = "ts", derive(TS))]
4640#[cfg_attr(feature = "ts", ts(export))]
4641#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4642#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4643#[cfg_attr(feature = "serde", serde(tag = "type"))]
4644#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4645#[repr(u32)]
4646#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4647pub enum WifiConfigApResponse {
4648 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4649 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4650 #[doc = "Changes accepted."]
4651 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4652 #[doc = "Changes rejected."]
4653 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4654 #[doc = "Invalid Mode."]
4655 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4656 #[doc = "Invalid SSID."]
4657 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4658 #[doc = "Invalid Password."]
4659 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4660}
4661impl WifiConfigApResponse {
4662 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4663}
4664impl Default for WifiConfigApResponse {
4665 fn default() -> Self {
4666 Self::DEFAULT
4667 }
4668}
4669#[cfg_attr(feature = "ts", derive(TS))]
4670#[cfg_attr(feature = "ts", ts(export))]
4671#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4672#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4673#[cfg_attr(feature = "serde", serde(tag = "type"))]
4674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4675#[repr(u32)]
4676#[doc = "Winch actions."]
4677pub enum WinchActions {
4678 #[doc = "Allow motor to freewheel."]
4679 WINCH_RELAXED = 0,
4680 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4681 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4682 #[doc = "Wind or unwind line at specified rate."]
4683 WINCH_RATE_CONTROL = 2,
4684 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4685 WINCH_LOCK = 3,
4686 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4687 WINCH_DELIVER = 4,
4688 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4689 WINCH_HOLD = 5,
4690 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4691 WINCH_RETRACT = 6,
4692 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4693 WINCH_LOAD_LINE = 7,
4694 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4695 WINCH_ABANDON_LINE = 8,
4696 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4697 WINCH_LOAD_PAYLOAD = 9,
4698}
4699impl WinchActions {
4700 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4701}
4702impl Default for WinchActions {
4703 fn default() -> Self {
4704 Self::DEFAULT
4705 }
4706}
4707#[doc = "Set the vehicle attitude and body angular rates."]
4708#[doc = ""]
4709#[doc = "ID: 140"]
4710#[derive(Debug, Clone, PartialEq)]
4711#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4713#[cfg_attr(feature = "ts", derive(TS))]
4714#[cfg_attr(feature = "ts", ts(export))]
4715pub struct ACTUATOR_CONTROL_TARGET_DATA {
4716 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4717 pub time_usec: u64,
4718 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4719 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4720 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4721 pub controls: [f32; 8],
4722 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4723 pub group_mlx: u8,
4724}
4725impl ACTUATOR_CONTROL_TARGET_DATA {
4726 pub const ENCODED_LEN: usize = 41usize;
4727 pub const DEFAULT: Self = Self {
4728 time_usec: 0_u64,
4729 controls: [0.0_f32; 8usize],
4730 group_mlx: 0_u8,
4731 };
4732 #[cfg(feature = "arbitrary")]
4733 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4734 use arbitrary::{Arbitrary, Unstructured};
4735 let mut buf = [0u8; 1024];
4736 rng.fill_bytes(&mut buf);
4737 let mut unstructured = Unstructured::new(&buf);
4738 Self::arbitrary(&mut unstructured).unwrap_or_default()
4739 }
4740}
4741impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4742 fn default() -> Self {
4743 Self::DEFAULT.clone()
4744 }
4745}
4746impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4747 type Message = MavMessage;
4748 const ID: u32 = 140u32;
4749 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4750 const EXTRA_CRC: u8 = 181u8;
4751 const ENCODED_LEN: usize = 41usize;
4752 fn deser(
4753 _version: MavlinkVersion,
4754 __input: &[u8],
4755 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4756 let avail_len = __input.len();
4757 let mut payload_buf = [0; Self::ENCODED_LEN];
4758 let mut buf = if avail_len < Self::ENCODED_LEN {
4759 payload_buf[0..avail_len].copy_from_slice(__input);
4760 Bytes::new(&payload_buf)
4761 } else {
4762 Bytes::new(__input)
4763 };
4764 let mut __struct = Self::default();
4765 __struct.time_usec = buf.get_u64_le();
4766 for v in &mut __struct.controls {
4767 let val = buf.get_f32_le();
4768 *v = val;
4769 }
4770 __struct.group_mlx = buf.get_u8();
4771 Ok(__struct)
4772 }
4773 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4774 let mut __tmp = BytesMut::new(bytes);
4775 #[allow(clippy::absurd_extreme_comparisons)]
4776 #[allow(unused_comparisons)]
4777 if __tmp.remaining() < Self::ENCODED_LEN {
4778 panic!(
4779 "buffer is too small (need {} bytes, but got {})",
4780 Self::ENCODED_LEN,
4781 __tmp.remaining(),
4782 )
4783 }
4784 __tmp.put_u64_le(self.time_usec);
4785 for val in &self.controls {
4786 __tmp.put_f32_le(*val);
4787 }
4788 __tmp.put_u8(self.group_mlx);
4789 if matches!(version, MavlinkVersion::V2) {
4790 let len = __tmp.len();
4791 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4792 } else {
4793 __tmp.len()
4794 }
4795 }
4796}
4797#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4798#[doc = ""]
4799#[doc = "ID: 375"]
4800#[derive(Debug, Clone, PartialEq)]
4801#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4802#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4803#[cfg_attr(feature = "ts", derive(TS))]
4804#[cfg_attr(feature = "ts", ts(export))]
4805pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4806 #[doc = "Timestamp (since system boot)."]
4807 pub time_usec: u64,
4808 #[doc = "Active outputs"]
4809 pub active: u32,
4810 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4811 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4812 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4813 pub actuator: [f32; 32],
4814}
4815impl ACTUATOR_OUTPUT_STATUS_DATA {
4816 pub const ENCODED_LEN: usize = 140usize;
4817 pub const DEFAULT: Self = Self {
4818 time_usec: 0_u64,
4819 active: 0_u32,
4820 actuator: [0.0_f32; 32usize],
4821 };
4822 #[cfg(feature = "arbitrary")]
4823 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4824 use arbitrary::{Arbitrary, Unstructured};
4825 let mut buf = [0u8; 1024];
4826 rng.fill_bytes(&mut buf);
4827 let mut unstructured = Unstructured::new(&buf);
4828 Self::arbitrary(&mut unstructured).unwrap_or_default()
4829 }
4830}
4831impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4832 fn default() -> Self {
4833 Self::DEFAULT.clone()
4834 }
4835}
4836impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4837 type Message = MavMessage;
4838 const ID: u32 = 375u32;
4839 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4840 const EXTRA_CRC: u8 = 251u8;
4841 const ENCODED_LEN: usize = 140usize;
4842 fn deser(
4843 _version: MavlinkVersion,
4844 __input: &[u8],
4845 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4846 let avail_len = __input.len();
4847 let mut payload_buf = [0; Self::ENCODED_LEN];
4848 let mut buf = if avail_len < Self::ENCODED_LEN {
4849 payload_buf[0..avail_len].copy_from_slice(__input);
4850 Bytes::new(&payload_buf)
4851 } else {
4852 Bytes::new(__input)
4853 };
4854 let mut __struct = Self::default();
4855 __struct.time_usec = buf.get_u64_le();
4856 __struct.active = buf.get_u32_le();
4857 for v in &mut __struct.actuator {
4858 let val = buf.get_f32_le();
4859 *v = val;
4860 }
4861 Ok(__struct)
4862 }
4863 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4864 let mut __tmp = BytesMut::new(bytes);
4865 #[allow(clippy::absurd_extreme_comparisons)]
4866 #[allow(unused_comparisons)]
4867 if __tmp.remaining() < Self::ENCODED_LEN {
4868 panic!(
4869 "buffer is too small (need {} bytes, but got {})",
4870 Self::ENCODED_LEN,
4871 __tmp.remaining(),
4872 )
4873 }
4874 __tmp.put_u64_le(self.time_usec);
4875 __tmp.put_u32_le(self.active);
4876 for val in &self.actuator {
4877 __tmp.put_f32_le(*val);
4878 }
4879 if matches!(version, MavlinkVersion::V2) {
4880 let len = __tmp.len();
4881 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4882 } else {
4883 __tmp.len()
4884 }
4885 }
4886}
4887#[doc = "The location and information of an ADSB vehicle."]
4888#[doc = ""]
4889#[doc = "ID: 246"]
4890#[derive(Debug, Clone, PartialEq)]
4891#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4892#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4893#[cfg_attr(feature = "ts", derive(TS))]
4894#[cfg_attr(feature = "ts", ts(export))]
4895pub struct ADSB_VEHICLE_DATA {
4896 #[doc = "ICAO address"]
4897 pub ICAO_address: u32,
4898 #[doc = "Latitude"]
4899 pub lat: i32,
4900 #[doc = "Longitude"]
4901 pub lon: i32,
4902 #[doc = "Altitude(ASL)"]
4903 pub altitude: i32,
4904 #[doc = "Course over ground"]
4905 pub heading: u16,
4906 #[doc = "The horizontal velocity"]
4907 pub hor_velocity: u16,
4908 #[doc = "The vertical velocity. Positive is up"]
4909 pub ver_velocity: i16,
4910 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4911 pub flags: AdsbFlags,
4912 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4913 pub squawk: u16,
4914 #[doc = "ADSB altitude type."]
4915 pub altitude_type: AdsbAltitudeType,
4916 #[doc = "The callsign, 8+null"]
4917 #[cfg_attr(
4918 feature = "serde",
4919 serde(
4920 serialize_with = "crate::nulstr::serialize::<_, 9>",
4921 deserialize_with = "crate::nulstr::deserialize::<_, 9>"
4922 )
4923 )]
4924 #[cfg_attr(feature = "ts", ts(type = "string"))]
4925 pub callsign: [u8; 9],
4926 #[doc = "ADSB emitter type."]
4927 pub emitter_type: AdsbEmitterType,
4928 #[doc = "Time since last communication in seconds"]
4929 pub tslc: u8,
4930}
4931impl ADSB_VEHICLE_DATA {
4932 pub const ENCODED_LEN: usize = 38usize;
4933 pub const DEFAULT: Self = Self {
4934 ICAO_address: 0_u32,
4935 lat: 0_i32,
4936 lon: 0_i32,
4937 altitude: 0_i32,
4938 heading: 0_u16,
4939 hor_velocity: 0_u16,
4940 ver_velocity: 0_i16,
4941 flags: AdsbFlags::DEFAULT,
4942 squawk: 0_u16,
4943 altitude_type: AdsbAltitudeType::DEFAULT,
4944 callsign: [0_u8; 9usize],
4945 emitter_type: AdsbEmitterType::DEFAULT,
4946 tslc: 0_u8,
4947 };
4948 #[cfg(feature = "arbitrary")]
4949 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4950 use arbitrary::{Arbitrary, Unstructured};
4951 let mut buf = [0u8; 1024];
4952 rng.fill_bytes(&mut buf);
4953 let mut unstructured = Unstructured::new(&buf);
4954 Self::arbitrary(&mut unstructured).unwrap_or_default()
4955 }
4956}
4957impl Default for ADSB_VEHICLE_DATA {
4958 fn default() -> Self {
4959 Self::DEFAULT.clone()
4960 }
4961}
4962impl MessageData for ADSB_VEHICLE_DATA {
4963 type Message = MavMessage;
4964 const ID: u32 = 246u32;
4965 const NAME: &'static str = "ADSB_VEHICLE";
4966 const EXTRA_CRC: u8 = 184u8;
4967 const ENCODED_LEN: usize = 38usize;
4968 fn deser(
4969 _version: MavlinkVersion,
4970 __input: &[u8],
4971 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4972 let avail_len = __input.len();
4973 let mut payload_buf = [0; Self::ENCODED_LEN];
4974 let mut buf = if avail_len < Self::ENCODED_LEN {
4975 payload_buf[0..avail_len].copy_from_slice(__input);
4976 Bytes::new(&payload_buf)
4977 } else {
4978 Bytes::new(__input)
4979 };
4980 let mut __struct = Self::default();
4981 __struct.ICAO_address = buf.get_u32_le();
4982 __struct.lat = buf.get_i32_le();
4983 __struct.lon = buf.get_i32_le();
4984 __struct.altitude = buf.get_i32_le();
4985 __struct.heading = buf.get_u16_le();
4986 __struct.hor_velocity = buf.get_u16_le();
4987 __struct.ver_velocity = buf.get_i16_le();
4988 let tmp = buf.get_u16_le();
4989 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
4990 ::mavlink_core::error::ParserError::InvalidFlag {
4991 flag_type: "AdsbFlags",
4992 value: tmp as u32,
4993 },
4994 )?;
4995 __struct.squawk = buf.get_u16_le();
4996 let tmp = buf.get_u8();
4997 __struct.altitude_type =
4998 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4999 enum_type: "AdsbAltitudeType",
5000 value: tmp as u32,
5001 })?;
5002 for v in &mut __struct.callsign {
5003 let val = buf.get_u8();
5004 *v = val;
5005 }
5006 let tmp = buf.get_u8();
5007 __struct.emitter_type =
5008 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5009 enum_type: "AdsbEmitterType",
5010 value: tmp as u32,
5011 })?;
5012 __struct.tslc = buf.get_u8();
5013 Ok(__struct)
5014 }
5015 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5016 let mut __tmp = BytesMut::new(bytes);
5017 #[allow(clippy::absurd_extreme_comparisons)]
5018 #[allow(unused_comparisons)]
5019 if __tmp.remaining() < Self::ENCODED_LEN {
5020 panic!(
5021 "buffer is too small (need {} bytes, but got {})",
5022 Self::ENCODED_LEN,
5023 __tmp.remaining(),
5024 )
5025 }
5026 __tmp.put_u32_le(self.ICAO_address);
5027 __tmp.put_i32_le(self.lat);
5028 __tmp.put_i32_le(self.lon);
5029 __tmp.put_i32_le(self.altitude);
5030 __tmp.put_u16_le(self.heading);
5031 __tmp.put_u16_le(self.hor_velocity);
5032 __tmp.put_i16_le(self.ver_velocity);
5033 __tmp.put_u16_le(self.flags.bits());
5034 __tmp.put_u16_le(self.squawk);
5035 __tmp.put_u8(self.altitude_type as u8);
5036 for val in &self.callsign {
5037 __tmp.put_u8(*val);
5038 }
5039 __tmp.put_u8(self.emitter_type as u8);
5040 __tmp.put_u8(self.tslc);
5041 if matches!(version, MavlinkVersion::V2) {
5042 let len = __tmp.len();
5043 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5044 } else {
5045 __tmp.len()
5046 }
5047 }
5048}
5049#[doc = "The airspeed measured by sensors and IMU."]
5050#[doc = ""]
5051#[doc = "ID: 182"]
5052#[derive(Debug, Clone, PartialEq)]
5053#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5054#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5055#[cfg_attr(feature = "ts", derive(TS))]
5056#[cfg_attr(feature = "ts", ts(export))]
5057pub struct AIRSPEEDS_DATA {
5058 #[doc = "Timestamp (milliseconds since system boot)"]
5059 pub time_boot_ms: u32,
5060 #[doc = "Airspeed estimate from IMU, cm/s"]
5061 pub airspeed_imu: i16,
5062 #[doc = "Pitot measured forward airpseed, cm/s"]
5063 pub airspeed_pitot: i16,
5064 #[doc = "Hot wire anenometer measured airspeed, cm/s"]
5065 pub airspeed_hot_wire: i16,
5066 #[doc = "Ultrasonic measured airspeed, cm/s"]
5067 pub airspeed_ultrasonic: i16,
5068 #[doc = "Angle of attack sensor, degrees * 10"]
5069 pub aoa: i16,
5070 #[doc = "Yaw angle sensor, degrees * 10"]
5071 pub aoy: i16,
5072}
5073impl AIRSPEEDS_DATA {
5074 pub const ENCODED_LEN: usize = 16usize;
5075 pub const DEFAULT: Self = Self {
5076 time_boot_ms: 0_u32,
5077 airspeed_imu: 0_i16,
5078 airspeed_pitot: 0_i16,
5079 airspeed_hot_wire: 0_i16,
5080 airspeed_ultrasonic: 0_i16,
5081 aoa: 0_i16,
5082 aoy: 0_i16,
5083 };
5084 #[cfg(feature = "arbitrary")]
5085 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5086 use arbitrary::{Arbitrary, Unstructured};
5087 let mut buf = [0u8; 1024];
5088 rng.fill_bytes(&mut buf);
5089 let mut unstructured = Unstructured::new(&buf);
5090 Self::arbitrary(&mut unstructured).unwrap_or_default()
5091 }
5092}
5093impl Default for AIRSPEEDS_DATA {
5094 fn default() -> Self {
5095 Self::DEFAULT.clone()
5096 }
5097}
5098impl MessageData for AIRSPEEDS_DATA {
5099 type Message = MavMessage;
5100 const ID: u32 = 182u32;
5101 const NAME: &'static str = "AIRSPEEDS";
5102 const EXTRA_CRC: u8 = 154u8;
5103 const ENCODED_LEN: usize = 16usize;
5104 fn deser(
5105 _version: MavlinkVersion,
5106 __input: &[u8],
5107 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5108 let avail_len = __input.len();
5109 let mut payload_buf = [0; Self::ENCODED_LEN];
5110 let mut buf = if avail_len < Self::ENCODED_LEN {
5111 payload_buf[0..avail_len].copy_from_slice(__input);
5112 Bytes::new(&payload_buf)
5113 } else {
5114 Bytes::new(__input)
5115 };
5116 let mut __struct = Self::default();
5117 __struct.time_boot_ms = buf.get_u32_le();
5118 __struct.airspeed_imu = buf.get_i16_le();
5119 __struct.airspeed_pitot = buf.get_i16_le();
5120 __struct.airspeed_hot_wire = buf.get_i16_le();
5121 __struct.airspeed_ultrasonic = buf.get_i16_le();
5122 __struct.aoa = buf.get_i16_le();
5123 __struct.aoy = buf.get_i16_le();
5124 Ok(__struct)
5125 }
5126 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5127 let mut __tmp = BytesMut::new(bytes);
5128 #[allow(clippy::absurd_extreme_comparisons)]
5129 #[allow(unused_comparisons)]
5130 if __tmp.remaining() < Self::ENCODED_LEN {
5131 panic!(
5132 "buffer is too small (need {} bytes, but got {})",
5133 Self::ENCODED_LEN,
5134 __tmp.remaining(),
5135 )
5136 }
5137 __tmp.put_u32_le(self.time_boot_ms);
5138 __tmp.put_i16_le(self.airspeed_imu);
5139 __tmp.put_i16_le(self.airspeed_pitot);
5140 __tmp.put_i16_le(self.airspeed_hot_wire);
5141 __tmp.put_i16_le(self.airspeed_ultrasonic);
5142 __tmp.put_i16_le(self.aoa);
5143 __tmp.put_i16_le(self.aoy);
5144 if matches!(version, MavlinkVersion::V2) {
5145 let len = __tmp.len();
5146 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5147 } else {
5148 __tmp.len()
5149 }
5150 }
5151}
5152#[doc = "The location and information of an AIS vessel."]
5153#[doc = ""]
5154#[doc = "ID: 301"]
5155#[derive(Debug, Clone, PartialEq)]
5156#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5157#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5158#[cfg_attr(feature = "ts", derive(TS))]
5159#[cfg_attr(feature = "ts", ts(export))]
5160pub struct AIS_VESSEL_DATA {
5161 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
5162 pub MMSI: u32,
5163 #[doc = "Latitude"]
5164 pub lat: i32,
5165 #[doc = "Longitude"]
5166 pub lon: i32,
5167 #[doc = "Course over ground"]
5168 pub COG: u16,
5169 #[doc = "True heading"]
5170 pub heading: u16,
5171 #[doc = "Speed over ground"]
5172 pub velocity: u16,
5173 #[doc = "Distance from lat/lon location to bow"]
5174 pub dimension_bow: u16,
5175 #[doc = "Distance from lat/lon location to stern"]
5176 pub dimension_stern: u16,
5177 #[doc = "Time since last communication in seconds"]
5178 pub tslc: u16,
5179 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5180 pub flags: AisFlags,
5181 #[doc = "Turn rate"]
5182 pub turn_rate: i8,
5183 #[doc = "Navigational status"]
5184 pub navigational_status: AisNavStatus,
5185 #[doc = "Type of vessels"]
5186 pub mavtype: AisType,
5187 #[doc = "Distance from lat/lon location to port side"]
5188 pub dimension_port: u8,
5189 #[doc = "Distance from lat/lon location to starboard side"]
5190 pub dimension_starboard: u8,
5191 #[doc = "The vessel callsign"]
5192 #[cfg_attr(
5193 feature = "serde",
5194 serde(
5195 serialize_with = "crate::nulstr::serialize::<_, 7>",
5196 deserialize_with = "crate::nulstr::deserialize::<_, 7>"
5197 )
5198 )]
5199 #[cfg_attr(feature = "ts", ts(type = "string"))]
5200 pub callsign: [u8; 7],
5201 #[doc = "The vessel name"]
5202 #[cfg_attr(
5203 feature = "serde",
5204 serde(
5205 serialize_with = "crate::nulstr::serialize::<_, 20>",
5206 deserialize_with = "crate::nulstr::deserialize::<_, 20>"
5207 )
5208 )]
5209 #[cfg_attr(feature = "ts", ts(type = "string"))]
5210 pub name: [u8; 20],
5211}
5212impl AIS_VESSEL_DATA {
5213 pub const ENCODED_LEN: usize = 58usize;
5214 pub const DEFAULT: Self = Self {
5215 MMSI: 0_u32,
5216 lat: 0_i32,
5217 lon: 0_i32,
5218 COG: 0_u16,
5219 heading: 0_u16,
5220 velocity: 0_u16,
5221 dimension_bow: 0_u16,
5222 dimension_stern: 0_u16,
5223 tslc: 0_u16,
5224 flags: AisFlags::DEFAULT,
5225 turn_rate: 0_i8,
5226 navigational_status: AisNavStatus::DEFAULT,
5227 mavtype: AisType::DEFAULT,
5228 dimension_port: 0_u8,
5229 dimension_starboard: 0_u8,
5230 callsign: [0_u8; 7usize],
5231 name: [0_u8; 20usize],
5232 };
5233 #[cfg(feature = "arbitrary")]
5234 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5235 use arbitrary::{Arbitrary, Unstructured};
5236 let mut buf = [0u8; 1024];
5237 rng.fill_bytes(&mut buf);
5238 let mut unstructured = Unstructured::new(&buf);
5239 Self::arbitrary(&mut unstructured).unwrap_or_default()
5240 }
5241}
5242impl Default for AIS_VESSEL_DATA {
5243 fn default() -> Self {
5244 Self::DEFAULT.clone()
5245 }
5246}
5247impl MessageData for AIS_VESSEL_DATA {
5248 type Message = MavMessage;
5249 const ID: u32 = 301u32;
5250 const NAME: &'static str = "AIS_VESSEL";
5251 const EXTRA_CRC: u8 = 243u8;
5252 const ENCODED_LEN: usize = 58usize;
5253 fn deser(
5254 _version: MavlinkVersion,
5255 __input: &[u8],
5256 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5257 let avail_len = __input.len();
5258 let mut payload_buf = [0; Self::ENCODED_LEN];
5259 let mut buf = if avail_len < Self::ENCODED_LEN {
5260 payload_buf[0..avail_len].copy_from_slice(__input);
5261 Bytes::new(&payload_buf)
5262 } else {
5263 Bytes::new(__input)
5264 };
5265 let mut __struct = Self::default();
5266 __struct.MMSI = buf.get_u32_le();
5267 __struct.lat = buf.get_i32_le();
5268 __struct.lon = buf.get_i32_le();
5269 __struct.COG = buf.get_u16_le();
5270 __struct.heading = buf.get_u16_le();
5271 __struct.velocity = buf.get_u16_le();
5272 __struct.dimension_bow = buf.get_u16_le();
5273 __struct.dimension_stern = buf.get_u16_le();
5274 __struct.tslc = buf.get_u16_le();
5275 let tmp = buf.get_u16_le();
5276 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
5277 ::mavlink_core::error::ParserError::InvalidFlag {
5278 flag_type: "AisFlags",
5279 value: tmp as u32,
5280 },
5281 )?;
5282 __struct.turn_rate = buf.get_i8();
5283 let tmp = buf.get_u8();
5284 __struct.navigational_status =
5285 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5286 enum_type: "AisNavStatus",
5287 value: tmp as u32,
5288 })?;
5289 let tmp = buf.get_u8();
5290 __struct.mavtype =
5291 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5292 enum_type: "AisType",
5293 value: tmp as u32,
5294 })?;
5295 __struct.dimension_port = buf.get_u8();
5296 __struct.dimension_starboard = buf.get_u8();
5297 for v in &mut __struct.callsign {
5298 let val = buf.get_u8();
5299 *v = val;
5300 }
5301 for v in &mut __struct.name {
5302 let val = buf.get_u8();
5303 *v = val;
5304 }
5305 Ok(__struct)
5306 }
5307 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5308 let mut __tmp = BytesMut::new(bytes);
5309 #[allow(clippy::absurd_extreme_comparisons)]
5310 #[allow(unused_comparisons)]
5311 if __tmp.remaining() < Self::ENCODED_LEN {
5312 panic!(
5313 "buffer is too small (need {} bytes, but got {})",
5314 Self::ENCODED_LEN,
5315 __tmp.remaining(),
5316 )
5317 }
5318 __tmp.put_u32_le(self.MMSI);
5319 __tmp.put_i32_le(self.lat);
5320 __tmp.put_i32_le(self.lon);
5321 __tmp.put_u16_le(self.COG);
5322 __tmp.put_u16_le(self.heading);
5323 __tmp.put_u16_le(self.velocity);
5324 __tmp.put_u16_le(self.dimension_bow);
5325 __tmp.put_u16_le(self.dimension_stern);
5326 __tmp.put_u16_le(self.tslc);
5327 __tmp.put_u16_le(self.flags.bits());
5328 __tmp.put_i8(self.turn_rate);
5329 __tmp.put_u8(self.navigational_status as u8);
5330 __tmp.put_u8(self.mavtype as u8);
5331 __tmp.put_u8(self.dimension_port);
5332 __tmp.put_u8(self.dimension_starboard);
5333 for val in &self.callsign {
5334 __tmp.put_u8(*val);
5335 }
5336 for val in &self.name {
5337 __tmp.put_u8(*val);
5338 }
5339 if matches!(version, MavlinkVersion::V2) {
5340 let len = __tmp.len();
5341 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5342 } else {
5343 __tmp.len()
5344 }
5345 }
5346}
5347#[doc = "The current system altitude."]
5348#[doc = ""]
5349#[doc = "ID: 141"]
5350#[derive(Debug, Clone, PartialEq)]
5351#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5352#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5353#[cfg_attr(feature = "ts", derive(TS))]
5354#[cfg_attr(feature = "ts", ts(export))]
5355pub struct ALTITUDE_DATA {
5356 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5357 pub time_usec: u64,
5358 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5359 pub altitude_monotonic: f32,
5360 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5361 pub altitude_amsl: f32,
5362 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5363 pub altitude_local: f32,
5364 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5365 pub altitude_relative: f32,
5366 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5367 pub altitude_terrain: f32,
5368 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5369 pub bottom_clearance: f32,
5370}
5371impl ALTITUDE_DATA {
5372 pub const ENCODED_LEN: usize = 32usize;
5373 pub const DEFAULT: Self = Self {
5374 time_usec: 0_u64,
5375 altitude_monotonic: 0.0_f32,
5376 altitude_amsl: 0.0_f32,
5377 altitude_local: 0.0_f32,
5378 altitude_relative: 0.0_f32,
5379 altitude_terrain: 0.0_f32,
5380 bottom_clearance: 0.0_f32,
5381 };
5382 #[cfg(feature = "arbitrary")]
5383 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5384 use arbitrary::{Arbitrary, Unstructured};
5385 let mut buf = [0u8; 1024];
5386 rng.fill_bytes(&mut buf);
5387 let mut unstructured = Unstructured::new(&buf);
5388 Self::arbitrary(&mut unstructured).unwrap_or_default()
5389 }
5390}
5391impl Default for ALTITUDE_DATA {
5392 fn default() -> Self {
5393 Self::DEFAULT.clone()
5394 }
5395}
5396impl MessageData for ALTITUDE_DATA {
5397 type Message = MavMessage;
5398 const ID: u32 = 141u32;
5399 const NAME: &'static str = "ALTITUDE";
5400 const EXTRA_CRC: u8 = 47u8;
5401 const ENCODED_LEN: usize = 32usize;
5402 fn deser(
5403 _version: MavlinkVersion,
5404 __input: &[u8],
5405 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5406 let avail_len = __input.len();
5407 let mut payload_buf = [0; Self::ENCODED_LEN];
5408 let mut buf = if avail_len < Self::ENCODED_LEN {
5409 payload_buf[0..avail_len].copy_from_slice(__input);
5410 Bytes::new(&payload_buf)
5411 } else {
5412 Bytes::new(__input)
5413 };
5414 let mut __struct = Self::default();
5415 __struct.time_usec = buf.get_u64_le();
5416 __struct.altitude_monotonic = buf.get_f32_le();
5417 __struct.altitude_amsl = buf.get_f32_le();
5418 __struct.altitude_local = buf.get_f32_le();
5419 __struct.altitude_relative = buf.get_f32_le();
5420 __struct.altitude_terrain = buf.get_f32_le();
5421 __struct.bottom_clearance = buf.get_f32_le();
5422 Ok(__struct)
5423 }
5424 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5425 let mut __tmp = BytesMut::new(bytes);
5426 #[allow(clippy::absurd_extreme_comparisons)]
5427 #[allow(unused_comparisons)]
5428 if __tmp.remaining() < Self::ENCODED_LEN {
5429 panic!(
5430 "buffer is too small (need {} bytes, but got {})",
5431 Self::ENCODED_LEN,
5432 __tmp.remaining(),
5433 )
5434 }
5435 __tmp.put_u64_le(self.time_usec);
5436 __tmp.put_f32_le(self.altitude_monotonic);
5437 __tmp.put_f32_le(self.altitude_amsl);
5438 __tmp.put_f32_le(self.altitude_local);
5439 __tmp.put_f32_le(self.altitude_relative);
5440 __tmp.put_f32_le(self.altitude_terrain);
5441 __tmp.put_f32_le(self.bottom_clearance);
5442 if matches!(version, MavlinkVersion::V2) {
5443 let len = __tmp.len();
5444 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5445 } else {
5446 __tmp.len()
5447 }
5448 }
5449}
5450#[doc = "The altitude measured by sensors and IMU."]
5451#[doc = ""]
5452#[doc = "ID: 181"]
5453#[derive(Debug, Clone, PartialEq)]
5454#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5455#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5456#[cfg_attr(feature = "ts", derive(TS))]
5457#[cfg_attr(feature = "ts", ts(export))]
5458pub struct ALTITUDES_DATA {
5459 #[doc = "Timestamp (milliseconds since system boot)"]
5460 pub time_boot_ms: u32,
5461 #[doc = "GPS altitude (MSL) in meters, expressed as * 1000 (millimeters)"]
5462 pub alt_gps: i32,
5463 #[doc = "IMU altitude above ground in meters, expressed as * 1000 (millimeters)"]
5464 pub alt_imu: i32,
5465 #[doc = "barometeric altitude above ground in meters, expressed as * 1000 (millimeters)"]
5466 pub alt_barometric: i32,
5467 #[doc = "Optical flow altitude above ground in meters, expressed as * 1000 (millimeters)"]
5468 pub alt_optical_flow: i32,
5469 #[doc = "Rangefinder Altitude above ground in meters, expressed as * 1000 (millimeters)"]
5470 pub alt_range_finder: i32,
5471 #[doc = "Extra altitude above ground in meters, expressed as * 1000 (millimeters)"]
5472 pub alt_extra: i32,
5473}
5474impl ALTITUDES_DATA {
5475 pub const ENCODED_LEN: usize = 28usize;
5476 pub const DEFAULT: Self = Self {
5477 time_boot_ms: 0_u32,
5478 alt_gps: 0_i32,
5479 alt_imu: 0_i32,
5480 alt_barometric: 0_i32,
5481 alt_optical_flow: 0_i32,
5482 alt_range_finder: 0_i32,
5483 alt_extra: 0_i32,
5484 };
5485 #[cfg(feature = "arbitrary")]
5486 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5487 use arbitrary::{Arbitrary, Unstructured};
5488 let mut buf = [0u8; 1024];
5489 rng.fill_bytes(&mut buf);
5490 let mut unstructured = Unstructured::new(&buf);
5491 Self::arbitrary(&mut unstructured).unwrap_or_default()
5492 }
5493}
5494impl Default for ALTITUDES_DATA {
5495 fn default() -> Self {
5496 Self::DEFAULT.clone()
5497 }
5498}
5499impl MessageData for ALTITUDES_DATA {
5500 type Message = MavMessage;
5501 const ID: u32 = 181u32;
5502 const NAME: &'static str = "ALTITUDES";
5503 const EXTRA_CRC: u8 = 55u8;
5504 const ENCODED_LEN: usize = 28usize;
5505 fn deser(
5506 _version: MavlinkVersion,
5507 __input: &[u8],
5508 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5509 let avail_len = __input.len();
5510 let mut payload_buf = [0; Self::ENCODED_LEN];
5511 let mut buf = if avail_len < Self::ENCODED_LEN {
5512 payload_buf[0..avail_len].copy_from_slice(__input);
5513 Bytes::new(&payload_buf)
5514 } else {
5515 Bytes::new(__input)
5516 };
5517 let mut __struct = Self::default();
5518 __struct.time_boot_ms = buf.get_u32_le();
5519 __struct.alt_gps = buf.get_i32_le();
5520 __struct.alt_imu = buf.get_i32_le();
5521 __struct.alt_barometric = buf.get_i32_le();
5522 __struct.alt_optical_flow = buf.get_i32_le();
5523 __struct.alt_range_finder = buf.get_i32_le();
5524 __struct.alt_extra = buf.get_i32_le();
5525 Ok(__struct)
5526 }
5527 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5528 let mut __tmp = BytesMut::new(bytes);
5529 #[allow(clippy::absurd_extreme_comparisons)]
5530 #[allow(unused_comparisons)]
5531 if __tmp.remaining() < Self::ENCODED_LEN {
5532 panic!(
5533 "buffer is too small (need {} bytes, but got {})",
5534 Self::ENCODED_LEN,
5535 __tmp.remaining(),
5536 )
5537 }
5538 __tmp.put_u32_le(self.time_boot_ms);
5539 __tmp.put_i32_le(self.alt_gps);
5540 __tmp.put_i32_le(self.alt_imu);
5541 __tmp.put_i32_le(self.alt_barometric);
5542 __tmp.put_i32_le(self.alt_optical_flow);
5543 __tmp.put_i32_le(self.alt_range_finder);
5544 __tmp.put_i32_le(self.alt_extra);
5545 if matches!(version, MavlinkVersion::V2) {
5546 let len = __tmp.len();
5547 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5548 } else {
5549 __tmp.len()
5550 }
5551 }
5552}
5553#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5554#[doc = ""]
5555#[doc = "ID: 30"]
5556#[derive(Debug, Clone, PartialEq)]
5557#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5558#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5559#[cfg_attr(feature = "ts", derive(TS))]
5560#[cfg_attr(feature = "ts", ts(export))]
5561pub struct ATTITUDE_DATA {
5562 #[doc = "Timestamp (time since system boot)."]
5563 pub time_boot_ms: u32,
5564 #[doc = "Roll angle (-pi..+pi)"]
5565 pub roll: f32,
5566 #[doc = "Pitch angle (-pi..+pi)"]
5567 pub pitch: f32,
5568 #[doc = "Yaw angle (-pi..+pi)"]
5569 pub yaw: f32,
5570 #[doc = "Roll angular speed"]
5571 pub rollspeed: f32,
5572 #[doc = "Pitch angular speed"]
5573 pub pitchspeed: f32,
5574 #[doc = "Yaw angular speed"]
5575 pub yawspeed: f32,
5576}
5577impl ATTITUDE_DATA {
5578 pub const ENCODED_LEN: usize = 28usize;
5579 pub const DEFAULT: Self = Self {
5580 time_boot_ms: 0_u32,
5581 roll: 0.0_f32,
5582 pitch: 0.0_f32,
5583 yaw: 0.0_f32,
5584 rollspeed: 0.0_f32,
5585 pitchspeed: 0.0_f32,
5586 yawspeed: 0.0_f32,
5587 };
5588 #[cfg(feature = "arbitrary")]
5589 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5590 use arbitrary::{Arbitrary, Unstructured};
5591 let mut buf = [0u8; 1024];
5592 rng.fill_bytes(&mut buf);
5593 let mut unstructured = Unstructured::new(&buf);
5594 Self::arbitrary(&mut unstructured).unwrap_or_default()
5595 }
5596}
5597impl Default for ATTITUDE_DATA {
5598 fn default() -> Self {
5599 Self::DEFAULT.clone()
5600 }
5601}
5602impl MessageData for ATTITUDE_DATA {
5603 type Message = MavMessage;
5604 const ID: u32 = 30u32;
5605 const NAME: &'static str = "ATTITUDE";
5606 const EXTRA_CRC: u8 = 39u8;
5607 const ENCODED_LEN: usize = 28usize;
5608 fn deser(
5609 _version: MavlinkVersion,
5610 __input: &[u8],
5611 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5612 let avail_len = __input.len();
5613 let mut payload_buf = [0; Self::ENCODED_LEN];
5614 let mut buf = if avail_len < Self::ENCODED_LEN {
5615 payload_buf[0..avail_len].copy_from_slice(__input);
5616 Bytes::new(&payload_buf)
5617 } else {
5618 Bytes::new(__input)
5619 };
5620 let mut __struct = Self::default();
5621 __struct.time_boot_ms = buf.get_u32_le();
5622 __struct.roll = buf.get_f32_le();
5623 __struct.pitch = buf.get_f32_le();
5624 __struct.yaw = buf.get_f32_le();
5625 __struct.rollspeed = buf.get_f32_le();
5626 __struct.pitchspeed = buf.get_f32_le();
5627 __struct.yawspeed = buf.get_f32_le();
5628 Ok(__struct)
5629 }
5630 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5631 let mut __tmp = BytesMut::new(bytes);
5632 #[allow(clippy::absurd_extreme_comparisons)]
5633 #[allow(unused_comparisons)]
5634 if __tmp.remaining() < Self::ENCODED_LEN {
5635 panic!(
5636 "buffer is too small (need {} bytes, but got {})",
5637 Self::ENCODED_LEN,
5638 __tmp.remaining(),
5639 )
5640 }
5641 __tmp.put_u32_le(self.time_boot_ms);
5642 __tmp.put_f32_le(self.roll);
5643 __tmp.put_f32_le(self.pitch);
5644 __tmp.put_f32_le(self.yaw);
5645 __tmp.put_f32_le(self.rollspeed);
5646 __tmp.put_f32_le(self.pitchspeed);
5647 __tmp.put_f32_le(self.yawspeed);
5648 if matches!(version, MavlinkVersion::V2) {
5649 let len = __tmp.len();
5650 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5651 } else {
5652 __tmp.len()
5653 }
5654 }
5655}
5656#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5657#[doc = ""]
5658#[doc = "ID: 31"]
5659#[derive(Debug, Clone, PartialEq)]
5660#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5661#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5662#[cfg_attr(feature = "ts", derive(TS))]
5663#[cfg_attr(feature = "ts", ts(export))]
5664pub struct ATTITUDE_QUATERNION_DATA {
5665 #[doc = "Timestamp (time since system boot)."]
5666 pub time_boot_ms: u32,
5667 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5668 pub q1: f32,
5669 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5670 pub q2: f32,
5671 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5672 pub q3: f32,
5673 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5674 pub q4: f32,
5675 #[doc = "Roll angular speed"]
5676 pub rollspeed: f32,
5677 #[doc = "Pitch angular speed"]
5678 pub pitchspeed: f32,
5679 #[doc = "Yaw angular speed"]
5680 pub yawspeed: f32,
5681 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5682 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5683 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5684 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5685 pub repr_offset_q: [f32; 4],
5686}
5687impl ATTITUDE_QUATERNION_DATA {
5688 pub const ENCODED_LEN: usize = 48usize;
5689 pub const DEFAULT: Self = Self {
5690 time_boot_ms: 0_u32,
5691 q1: 0.0_f32,
5692 q2: 0.0_f32,
5693 q3: 0.0_f32,
5694 q4: 0.0_f32,
5695 rollspeed: 0.0_f32,
5696 pitchspeed: 0.0_f32,
5697 yawspeed: 0.0_f32,
5698 repr_offset_q: [0.0_f32; 4usize],
5699 };
5700 #[cfg(feature = "arbitrary")]
5701 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5702 use arbitrary::{Arbitrary, Unstructured};
5703 let mut buf = [0u8; 1024];
5704 rng.fill_bytes(&mut buf);
5705 let mut unstructured = Unstructured::new(&buf);
5706 Self::arbitrary(&mut unstructured).unwrap_or_default()
5707 }
5708}
5709impl Default for ATTITUDE_QUATERNION_DATA {
5710 fn default() -> Self {
5711 Self::DEFAULT.clone()
5712 }
5713}
5714impl MessageData for ATTITUDE_QUATERNION_DATA {
5715 type Message = MavMessage;
5716 const ID: u32 = 31u32;
5717 const NAME: &'static str = "ATTITUDE_QUATERNION";
5718 const EXTRA_CRC: u8 = 246u8;
5719 const ENCODED_LEN: usize = 48usize;
5720 fn deser(
5721 _version: MavlinkVersion,
5722 __input: &[u8],
5723 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5724 let avail_len = __input.len();
5725 let mut payload_buf = [0; Self::ENCODED_LEN];
5726 let mut buf = if avail_len < Self::ENCODED_LEN {
5727 payload_buf[0..avail_len].copy_from_slice(__input);
5728 Bytes::new(&payload_buf)
5729 } else {
5730 Bytes::new(__input)
5731 };
5732 let mut __struct = Self::default();
5733 __struct.time_boot_ms = buf.get_u32_le();
5734 __struct.q1 = buf.get_f32_le();
5735 __struct.q2 = buf.get_f32_le();
5736 __struct.q3 = buf.get_f32_le();
5737 __struct.q4 = buf.get_f32_le();
5738 __struct.rollspeed = buf.get_f32_le();
5739 __struct.pitchspeed = buf.get_f32_le();
5740 __struct.yawspeed = buf.get_f32_le();
5741 for v in &mut __struct.repr_offset_q {
5742 let val = buf.get_f32_le();
5743 *v = val;
5744 }
5745 Ok(__struct)
5746 }
5747 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5748 let mut __tmp = BytesMut::new(bytes);
5749 #[allow(clippy::absurd_extreme_comparisons)]
5750 #[allow(unused_comparisons)]
5751 if __tmp.remaining() < Self::ENCODED_LEN {
5752 panic!(
5753 "buffer is too small (need {} bytes, but got {})",
5754 Self::ENCODED_LEN,
5755 __tmp.remaining(),
5756 )
5757 }
5758 __tmp.put_u32_le(self.time_boot_ms);
5759 __tmp.put_f32_le(self.q1);
5760 __tmp.put_f32_le(self.q2);
5761 __tmp.put_f32_le(self.q3);
5762 __tmp.put_f32_le(self.q4);
5763 __tmp.put_f32_le(self.rollspeed);
5764 __tmp.put_f32_le(self.pitchspeed);
5765 __tmp.put_f32_le(self.yawspeed);
5766 if matches!(version, MavlinkVersion::V2) {
5767 for val in &self.repr_offset_q {
5768 __tmp.put_f32_le(*val);
5769 }
5770 let len = __tmp.len();
5771 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5772 } else {
5773 __tmp.len()
5774 }
5775 }
5776}
5777#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5778#[doc = ""]
5779#[doc = "ID: 61"]
5780#[derive(Debug, Clone, PartialEq)]
5781#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5782#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5783#[cfg_attr(feature = "ts", derive(TS))]
5784#[cfg_attr(feature = "ts", ts(export))]
5785pub struct ATTITUDE_QUATERNION_COV_DATA {
5786 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5787 pub time_usec: u64,
5788 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5789 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5790 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5791 pub q: [f32; 4],
5792 #[doc = "Roll angular speed"]
5793 pub rollspeed: f32,
5794 #[doc = "Pitch angular speed"]
5795 pub pitchspeed: f32,
5796 #[doc = "Yaw angular speed"]
5797 pub yawspeed: f32,
5798 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5799 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5800 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5801 pub covariance: [f32; 9],
5802}
5803impl ATTITUDE_QUATERNION_COV_DATA {
5804 pub const ENCODED_LEN: usize = 72usize;
5805 pub const DEFAULT: Self = Self {
5806 time_usec: 0_u64,
5807 q: [0.0_f32; 4usize],
5808 rollspeed: 0.0_f32,
5809 pitchspeed: 0.0_f32,
5810 yawspeed: 0.0_f32,
5811 covariance: [0.0_f32; 9usize],
5812 };
5813 #[cfg(feature = "arbitrary")]
5814 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5815 use arbitrary::{Arbitrary, Unstructured};
5816 let mut buf = [0u8; 1024];
5817 rng.fill_bytes(&mut buf);
5818 let mut unstructured = Unstructured::new(&buf);
5819 Self::arbitrary(&mut unstructured).unwrap_or_default()
5820 }
5821}
5822impl Default for ATTITUDE_QUATERNION_COV_DATA {
5823 fn default() -> Self {
5824 Self::DEFAULT.clone()
5825 }
5826}
5827impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5828 type Message = MavMessage;
5829 const ID: u32 = 61u32;
5830 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5831 const EXTRA_CRC: u8 = 167u8;
5832 const ENCODED_LEN: usize = 72usize;
5833 fn deser(
5834 _version: MavlinkVersion,
5835 __input: &[u8],
5836 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5837 let avail_len = __input.len();
5838 let mut payload_buf = [0; Self::ENCODED_LEN];
5839 let mut buf = if avail_len < Self::ENCODED_LEN {
5840 payload_buf[0..avail_len].copy_from_slice(__input);
5841 Bytes::new(&payload_buf)
5842 } else {
5843 Bytes::new(__input)
5844 };
5845 let mut __struct = Self::default();
5846 __struct.time_usec = buf.get_u64_le();
5847 for v in &mut __struct.q {
5848 let val = buf.get_f32_le();
5849 *v = val;
5850 }
5851 __struct.rollspeed = buf.get_f32_le();
5852 __struct.pitchspeed = buf.get_f32_le();
5853 __struct.yawspeed = buf.get_f32_le();
5854 for v in &mut __struct.covariance {
5855 let val = buf.get_f32_le();
5856 *v = val;
5857 }
5858 Ok(__struct)
5859 }
5860 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5861 let mut __tmp = BytesMut::new(bytes);
5862 #[allow(clippy::absurd_extreme_comparisons)]
5863 #[allow(unused_comparisons)]
5864 if __tmp.remaining() < Self::ENCODED_LEN {
5865 panic!(
5866 "buffer is too small (need {} bytes, but got {})",
5867 Self::ENCODED_LEN,
5868 __tmp.remaining(),
5869 )
5870 }
5871 __tmp.put_u64_le(self.time_usec);
5872 for val in &self.q {
5873 __tmp.put_f32_le(*val);
5874 }
5875 __tmp.put_f32_le(self.rollspeed);
5876 __tmp.put_f32_le(self.pitchspeed);
5877 __tmp.put_f32_le(self.yawspeed);
5878 for val in &self.covariance {
5879 __tmp.put_f32_le(*val);
5880 }
5881 if matches!(version, MavlinkVersion::V2) {
5882 let len = __tmp.len();
5883 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5884 } else {
5885 __tmp.len()
5886 }
5887 }
5888}
5889#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5890#[doc = ""]
5891#[doc = "ID: 83"]
5892#[derive(Debug, Clone, PartialEq)]
5893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5894#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5895#[cfg_attr(feature = "ts", derive(TS))]
5896#[cfg_attr(feature = "ts", ts(export))]
5897pub struct ATTITUDE_TARGET_DATA {
5898 #[doc = "Timestamp (time since system boot)."]
5899 pub time_boot_ms: u32,
5900 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5901 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5902 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5903 pub q: [f32; 4],
5904 #[doc = "Body roll rate"]
5905 pub body_roll_rate: f32,
5906 #[doc = "Body pitch rate"]
5907 pub body_pitch_rate: f32,
5908 #[doc = "Body yaw rate"]
5909 pub body_yaw_rate: f32,
5910 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5911 pub thrust: f32,
5912 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5913 pub type_mask: AttitudeTargetTypemask,
5914}
5915impl ATTITUDE_TARGET_DATA {
5916 pub const ENCODED_LEN: usize = 37usize;
5917 pub const DEFAULT: Self = Self {
5918 time_boot_ms: 0_u32,
5919 q: [0.0_f32; 4usize],
5920 body_roll_rate: 0.0_f32,
5921 body_pitch_rate: 0.0_f32,
5922 body_yaw_rate: 0.0_f32,
5923 thrust: 0.0_f32,
5924 type_mask: AttitudeTargetTypemask::DEFAULT,
5925 };
5926 #[cfg(feature = "arbitrary")]
5927 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5928 use arbitrary::{Arbitrary, Unstructured};
5929 let mut buf = [0u8; 1024];
5930 rng.fill_bytes(&mut buf);
5931 let mut unstructured = Unstructured::new(&buf);
5932 Self::arbitrary(&mut unstructured).unwrap_or_default()
5933 }
5934}
5935impl Default for ATTITUDE_TARGET_DATA {
5936 fn default() -> Self {
5937 Self::DEFAULT.clone()
5938 }
5939}
5940impl MessageData for ATTITUDE_TARGET_DATA {
5941 type Message = MavMessage;
5942 const ID: u32 = 83u32;
5943 const NAME: &'static str = "ATTITUDE_TARGET";
5944 const EXTRA_CRC: u8 = 22u8;
5945 const ENCODED_LEN: usize = 37usize;
5946 fn deser(
5947 _version: MavlinkVersion,
5948 __input: &[u8],
5949 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5950 let avail_len = __input.len();
5951 let mut payload_buf = [0; Self::ENCODED_LEN];
5952 let mut buf = if avail_len < Self::ENCODED_LEN {
5953 payload_buf[0..avail_len].copy_from_slice(__input);
5954 Bytes::new(&payload_buf)
5955 } else {
5956 Bytes::new(__input)
5957 };
5958 let mut __struct = Self::default();
5959 __struct.time_boot_ms = buf.get_u32_le();
5960 for v in &mut __struct.q {
5961 let val = buf.get_f32_le();
5962 *v = val;
5963 }
5964 __struct.body_roll_rate = buf.get_f32_le();
5965 __struct.body_pitch_rate = buf.get_f32_le();
5966 __struct.body_yaw_rate = buf.get_f32_le();
5967 __struct.thrust = buf.get_f32_le();
5968 let tmp = buf.get_u8();
5969 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5970 tmp & AttitudeTargetTypemask::all().bits(),
5971 )
5972 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5973 flag_type: "AttitudeTargetTypemask",
5974 value: tmp as u32,
5975 })?;
5976 Ok(__struct)
5977 }
5978 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5979 let mut __tmp = BytesMut::new(bytes);
5980 #[allow(clippy::absurd_extreme_comparisons)]
5981 #[allow(unused_comparisons)]
5982 if __tmp.remaining() < Self::ENCODED_LEN {
5983 panic!(
5984 "buffer is too small (need {} bytes, but got {})",
5985 Self::ENCODED_LEN,
5986 __tmp.remaining(),
5987 )
5988 }
5989 __tmp.put_u32_le(self.time_boot_ms);
5990 for val in &self.q {
5991 __tmp.put_f32_le(*val);
5992 }
5993 __tmp.put_f32_le(self.body_roll_rate);
5994 __tmp.put_f32_le(self.body_pitch_rate);
5995 __tmp.put_f32_le(self.body_yaw_rate);
5996 __tmp.put_f32_le(self.thrust);
5997 __tmp.put_u8(self.type_mask.bits());
5998 if matches!(version, MavlinkVersion::V2) {
5999 let len = __tmp.len();
6000 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6001 } else {
6002 __tmp.len()
6003 }
6004 }
6005}
6006#[doc = "Motion capture attitude and position."]
6007#[doc = ""]
6008#[doc = "ID: 138"]
6009#[derive(Debug, Clone, PartialEq)]
6010#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6011#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6012#[cfg_attr(feature = "ts", derive(TS))]
6013#[cfg_attr(feature = "ts", ts(export))]
6014pub struct ATT_POS_MOCAP_DATA {
6015 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
6016 pub time_usec: u64,
6017 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6018 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6019 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6020 pub q: [f32; 4],
6021 #[doc = "X position (NED)"]
6022 pub x: f32,
6023 #[doc = "Y position (NED)"]
6024 pub y: f32,
6025 #[doc = "Z position (NED)"]
6026 pub z: f32,
6027 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
6028 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6029 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6030 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6031 pub covariance: [f32; 21],
6032}
6033impl ATT_POS_MOCAP_DATA {
6034 pub const ENCODED_LEN: usize = 120usize;
6035 pub const DEFAULT: Self = Self {
6036 time_usec: 0_u64,
6037 q: [0.0_f32; 4usize],
6038 x: 0.0_f32,
6039 y: 0.0_f32,
6040 z: 0.0_f32,
6041 covariance: [0.0_f32; 21usize],
6042 };
6043 #[cfg(feature = "arbitrary")]
6044 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6045 use arbitrary::{Arbitrary, Unstructured};
6046 let mut buf = [0u8; 1024];
6047 rng.fill_bytes(&mut buf);
6048 let mut unstructured = Unstructured::new(&buf);
6049 Self::arbitrary(&mut unstructured).unwrap_or_default()
6050 }
6051}
6052impl Default for ATT_POS_MOCAP_DATA {
6053 fn default() -> Self {
6054 Self::DEFAULT.clone()
6055 }
6056}
6057impl MessageData for ATT_POS_MOCAP_DATA {
6058 type Message = MavMessage;
6059 const ID: u32 = 138u32;
6060 const NAME: &'static str = "ATT_POS_MOCAP";
6061 const EXTRA_CRC: u8 = 109u8;
6062 const ENCODED_LEN: usize = 120usize;
6063 fn deser(
6064 _version: MavlinkVersion,
6065 __input: &[u8],
6066 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6067 let avail_len = __input.len();
6068 let mut payload_buf = [0; Self::ENCODED_LEN];
6069 let mut buf = if avail_len < Self::ENCODED_LEN {
6070 payload_buf[0..avail_len].copy_from_slice(__input);
6071 Bytes::new(&payload_buf)
6072 } else {
6073 Bytes::new(__input)
6074 };
6075 let mut __struct = Self::default();
6076 __struct.time_usec = buf.get_u64_le();
6077 for v in &mut __struct.q {
6078 let val = buf.get_f32_le();
6079 *v = val;
6080 }
6081 __struct.x = buf.get_f32_le();
6082 __struct.y = buf.get_f32_le();
6083 __struct.z = buf.get_f32_le();
6084 for v in &mut __struct.covariance {
6085 let val = buf.get_f32_le();
6086 *v = val;
6087 }
6088 Ok(__struct)
6089 }
6090 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6091 let mut __tmp = BytesMut::new(bytes);
6092 #[allow(clippy::absurd_extreme_comparisons)]
6093 #[allow(unused_comparisons)]
6094 if __tmp.remaining() < Self::ENCODED_LEN {
6095 panic!(
6096 "buffer is too small (need {} bytes, but got {})",
6097 Self::ENCODED_LEN,
6098 __tmp.remaining(),
6099 )
6100 }
6101 __tmp.put_u64_le(self.time_usec);
6102 for val in &self.q {
6103 __tmp.put_f32_le(*val);
6104 }
6105 __tmp.put_f32_le(self.x);
6106 __tmp.put_f32_le(self.y);
6107 __tmp.put_f32_le(self.z);
6108 if matches!(version, MavlinkVersion::V2) {
6109 for val in &self.covariance {
6110 __tmp.put_f32_le(*val);
6111 }
6112 let len = __tmp.len();
6113 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6114 } else {
6115 __tmp.len()
6116 }
6117 }
6118}
6119#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
6120#[doc = ""]
6121#[doc = "ID: 7"]
6122#[derive(Debug, Clone, PartialEq)]
6123#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6124#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6125#[cfg_attr(feature = "ts", derive(TS))]
6126#[cfg_attr(feature = "ts", ts(export))]
6127pub struct AUTH_KEY_DATA {
6128 #[doc = "key"]
6129 #[cfg_attr(
6130 feature = "serde",
6131 serde(
6132 serialize_with = "crate::nulstr::serialize::<_, 32>",
6133 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
6134 )
6135 )]
6136 #[cfg_attr(feature = "ts", ts(type = "string"))]
6137 pub key: [u8; 32],
6138}
6139impl AUTH_KEY_DATA {
6140 pub const ENCODED_LEN: usize = 32usize;
6141 pub const DEFAULT: Self = Self {
6142 key: [0_u8; 32usize],
6143 };
6144 #[cfg(feature = "arbitrary")]
6145 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6146 use arbitrary::{Arbitrary, Unstructured};
6147 let mut buf = [0u8; 1024];
6148 rng.fill_bytes(&mut buf);
6149 let mut unstructured = Unstructured::new(&buf);
6150 Self::arbitrary(&mut unstructured).unwrap_or_default()
6151 }
6152}
6153impl Default for AUTH_KEY_DATA {
6154 fn default() -> Self {
6155 Self::DEFAULT.clone()
6156 }
6157}
6158impl MessageData for AUTH_KEY_DATA {
6159 type Message = MavMessage;
6160 const ID: u32 = 7u32;
6161 const NAME: &'static str = "AUTH_KEY";
6162 const EXTRA_CRC: u8 = 119u8;
6163 const ENCODED_LEN: usize = 32usize;
6164 fn deser(
6165 _version: MavlinkVersion,
6166 __input: &[u8],
6167 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6168 let avail_len = __input.len();
6169 let mut payload_buf = [0; Self::ENCODED_LEN];
6170 let mut buf = if avail_len < Self::ENCODED_LEN {
6171 payload_buf[0..avail_len].copy_from_slice(__input);
6172 Bytes::new(&payload_buf)
6173 } else {
6174 Bytes::new(__input)
6175 };
6176 let mut __struct = Self::default();
6177 for v in &mut __struct.key {
6178 let val = buf.get_u8();
6179 *v = val;
6180 }
6181 Ok(__struct)
6182 }
6183 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6184 let mut __tmp = BytesMut::new(bytes);
6185 #[allow(clippy::absurd_extreme_comparisons)]
6186 #[allow(unused_comparisons)]
6187 if __tmp.remaining() < Self::ENCODED_LEN {
6188 panic!(
6189 "buffer is too small (need {} bytes, but got {})",
6190 Self::ENCODED_LEN,
6191 __tmp.remaining(),
6192 )
6193 }
6194 for val in &self.key {
6195 __tmp.put_u8(*val);
6196 }
6197 if matches!(version, MavlinkVersion::V2) {
6198 let len = __tmp.len();
6199 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6200 } else {
6201 __tmp.len()
6202 }
6203 }
6204}
6205#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
6206#[doc = ""]
6207#[doc = "ID: 286"]
6208#[derive(Debug, Clone, PartialEq)]
6209#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6211#[cfg_attr(feature = "ts", derive(TS))]
6212#[cfg_attr(feature = "ts", ts(export))]
6213pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6214 #[doc = "Timestamp (time since system boot)."]
6215 pub time_boot_us: u64,
6216 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
6217 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6218 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6219 pub q: [f32; 4],
6220 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
6221 pub q_estimated_delay_us: u32,
6222 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
6223 pub vx: f32,
6224 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
6225 pub vy: f32,
6226 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
6227 pub vz: f32,
6228 #[doc = "Estimated delay of the speed data. 0 if unknown."]
6229 pub v_estimated_delay_us: u32,
6230 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
6231 pub feed_forward_angular_velocity_z: f32,
6232 #[doc = "Bitmap indicating which estimator outputs are valid."]
6233 pub estimator_status: EstimatorStatusFlags,
6234 #[doc = "System ID"]
6235 pub target_system: u8,
6236 #[doc = "Component ID"]
6237 pub target_component: u8,
6238 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
6239 pub landed_state: MavLandedState,
6240 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
6241 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6242 pub angular_velocity_z: f32,
6243}
6244impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6245 pub const ENCODED_LEN: usize = 57usize;
6246 pub const DEFAULT: Self = Self {
6247 time_boot_us: 0_u64,
6248 q: [0.0_f32; 4usize],
6249 q_estimated_delay_us: 0_u32,
6250 vx: 0.0_f32,
6251 vy: 0.0_f32,
6252 vz: 0.0_f32,
6253 v_estimated_delay_us: 0_u32,
6254 feed_forward_angular_velocity_z: 0.0_f32,
6255 estimator_status: EstimatorStatusFlags::DEFAULT,
6256 target_system: 0_u8,
6257 target_component: 0_u8,
6258 landed_state: MavLandedState::DEFAULT,
6259 angular_velocity_z: 0.0_f32,
6260 };
6261 #[cfg(feature = "arbitrary")]
6262 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6263 use arbitrary::{Arbitrary, Unstructured};
6264 let mut buf = [0u8; 1024];
6265 rng.fill_bytes(&mut buf);
6266 let mut unstructured = Unstructured::new(&buf);
6267 Self::arbitrary(&mut unstructured).unwrap_or_default()
6268 }
6269}
6270impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6271 fn default() -> Self {
6272 Self::DEFAULT.clone()
6273 }
6274}
6275impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6276 type Message = MavMessage;
6277 const ID: u32 = 286u32;
6278 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6279 const EXTRA_CRC: u8 = 210u8;
6280 const ENCODED_LEN: usize = 57usize;
6281 fn deser(
6282 _version: MavlinkVersion,
6283 __input: &[u8],
6284 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6285 let avail_len = __input.len();
6286 let mut payload_buf = [0; Self::ENCODED_LEN];
6287 let mut buf = if avail_len < Self::ENCODED_LEN {
6288 payload_buf[0..avail_len].copy_from_slice(__input);
6289 Bytes::new(&payload_buf)
6290 } else {
6291 Bytes::new(__input)
6292 };
6293 let mut __struct = Self::default();
6294 __struct.time_boot_us = buf.get_u64_le();
6295 for v in &mut __struct.q {
6296 let val = buf.get_f32_le();
6297 *v = val;
6298 }
6299 __struct.q_estimated_delay_us = buf.get_u32_le();
6300 __struct.vx = buf.get_f32_le();
6301 __struct.vy = buf.get_f32_le();
6302 __struct.vz = buf.get_f32_le();
6303 __struct.v_estimated_delay_us = buf.get_u32_le();
6304 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
6305 let tmp = buf.get_u16_le();
6306 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6307 tmp & EstimatorStatusFlags::all().bits(),
6308 )
6309 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6310 flag_type: "EstimatorStatusFlags",
6311 value: tmp as u32,
6312 })?;
6313 __struct.target_system = buf.get_u8();
6314 __struct.target_component = buf.get_u8();
6315 let tmp = buf.get_u8();
6316 __struct.landed_state =
6317 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6318 enum_type: "MavLandedState",
6319 value: tmp as u32,
6320 })?;
6321 __struct.angular_velocity_z = buf.get_f32_le();
6322 Ok(__struct)
6323 }
6324 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6325 let mut __tmp = BytesMut::new(bytes);
6326 #[allow(clippy::absurd_extreme_comparisons)]
6327 #[allow(unused_comparisons)]
6328 if __tmp.remaining() < Self::ENCODED_LEN {
6329 panic!(
6330 "buffer is too small (need {} bytes, but got {})",
6331 Self::ENCODED_LEN,
6332 __tmp.remaining(),
6333 )
6334 }
6335 __tmp.put_u64_le(self.time_boot_us);
6336 for val in &self.q {
6337 __tmp.put_f32_le(*val);
6338 }
6339 __tmp.put_u32_le(self.q_estimated_delay_us);
6340 __tmp.put_f32_le(self.vx);
6341 __tmp.put_f32_le(self.vy);
6342 __tmp.put_f32_le(self.vz);
6343 __tmp.put_u32_le(self.v_estimated_delay_us);
6344 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6345 __tmp.put_u16_le(self.estimator_status.bits());
6346 __tmp.put_u8(self.target_system);
6347 __tmp.put_u8(self.target_component);
6348 __tmp.put_u8(self.landed_state as u8);
6349 if matches!(version, MavlinkVersion::V2) {
6350 __tmp.put_f32_le(self.angular_velocity_z);
6351 let len = __tmp.len();
6352 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6353 } else {
6354 __tmp.len()
6355 }
6356 }
6357}
6358#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6359#[doc = ""]
6360#[doc = "ID: 148"]
6361#[derive(Debug, Clone, PartialEq)]
6362#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6363#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6364#[cfg_attr(feature = "ts", derive(TS))]
6365#[cfg_attr(feature = "ts", ts(export))]
6366pub struct AUTOPILOT_VERSION_DATA {
6367 #[doc = "Bitmap of capabilities"]
6368 pub capabilities: MavProtocolCapability,
6369 #[doc = "UID if provided by hardware (see uid2)"]
6370 pub uid: u64,
6371 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6372 pub flight_sw_version: u32,
6373 #[doc = "Middleware version number"]
6374 pub middleware_sw_version: u32,
6375 #[doc = "Operating system version number"]
6376 pub os_sw_version: u32,
6377 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6378 pub board_version: u32,
6379 #[doc = "ID of the board vendor"]
6380 pub vendor_id: u16,
6381 #[doc = "ID of the product"]
6382 pub product_id: u16,
6383 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6384 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6385 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6386 pub flight_custom_version: [u8; 8],
6387 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6388 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6389 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6390 pub middleware_custom_version: [u8; 8],
6391 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6392 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6393 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6394 pub os_custom_version: [u8; 8],
6395 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6396 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6397 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6398 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6399 pub uid2: [u8; 18],
6400}
6401impl AUTOPILOT_VERSION_DATA {
6402 pub const ENCODED_LEN: usize = 78usize;
6403 pub const DEFAULT: Self = Self {
6404 capabilities: MavProtocolCapability::DEFAULT,
6405 uid: 0_u64,
6406 flight_sw_version: 0_u32,
6407 middleware_sw_version: 0_u32,
6408 os_sw_version: 0_u32,
6409 board_version: 0_u32,
6410 vendor_id: 0_u16,
6411 product_id: 0_u16,
6412 flight_custom_version: [0_u8; 8usize],
6413 middleware_custom_version: [0_u8; 8usize],
6414 os_custom_version: [0_u8; 8usize],
6415 uid2: [0_u8; 18usize],
6416 };
6417 #[cfg(feature = "arbitrary")]
6418 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6419 use arbitrary::{Arbitrary, Unstructured};
6420 let mut buf = [0u8; 1024];
6421 rng.fill_bytes(&mut buf);
6422 let mut unstructured = Unstructured::new(&buf);
6423 Self::arbitrary(&mut unstructured).unwrap_or_default()
6424 }
6425}
6426impl Default for AUTOPILOT_VERSION_DATA {
6427 fn default() -> Self {
6428 Self::DEFAULT.clone()
6429 }
6430}
6431impl MessageData for AUTOPILOT_VERSION_DATA {
6432 type Message = MavMessage;
6433 const ID: u32 = 148u32;
6434 const NAME: &'static str = "AUTOPILOT_VERSION";
6435 const EXTRA_CRC: u8 = 178u8;
6436 const ENCODED_LEN: usize = 78usize;
6437 fn deser(
6438 _version: MavlinkVersion,
6439 __input: &[u8],
6440 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6441 let avail_len = __input.len();
6442 let mut payload_buf = [0; Self::ENCODED_LEN];
6443 let mut buf = if avail_len < Self::ENCODED_LEN {
6444 payload_buf[0..avail_len].copy_from_slice(__input);
6445 Bytes::new(&payload_buf)
6446 } else {
6447 Bytes::new(__input)
6448 };
6449 let mut __struct = Self::default();
6450 let tmp = buf.get_u64_le();
6451 __struct.capabilities = MavProtocolCapability::from_bits(
6452 tmp & MavProtocolCapability::all().bits(),
6453 )
6454 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6455 flag_type: "MavProtocolCapability",
6456 value: tmp as u32,
6457 })?;
6458 __struct.uid = buf.get_u64_le();
6459 __struct.flight_sw_version = buf.get_u32_le();
6460 __struct.middleware_sw_version = buf.get_u32_le();
6461 __struct.os_sw_version = buf.get_u32_le();
6462 __struct.board_version = buf.get_u32_le();
6463 __struct.vendor_id = buf.get_u16_le();
6464 __struct.product_id = buf.get_u16_le();
6465 for v in &mut __struct.flight_custom_version {
6466 let val = buf.get_u8();
6467 *v = val;
6468 }
6469 for v in &mut __struct.middleware_custom_version {
6470 let val = buf.get_u8();
6471 *v = val;
6472 }
6473 for v in &mut __struct.os_custom_version {
6474 let val = buf.get_u8();
6475 *v = val;
6476 }
6477 for v in &mut __struct.uid2 {
6478 let val = buf.get_u8();
6479 *v = val;
6480 }
6481 Ok(__struct)
6482 }
6483 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6484 let mut __tmp = BytesMut::new(bytes);
6485 #[allow(clippy::absurd_extreme_comparisons)]
6486 #[allow(unused_comparisons)]
6487 if __tmp.remaining() < Self::ENCODED_LEN {
6488 panic!(
6489 "buffer is too small (need {} bytes, but got {})",
6490 Self::ENCODED_LEN,
6491 __tmp.remaining(),
6492 )
6493 }
6494 __tmp.put_u64_le(self.capabilities.bits());
6495 __tmp.put_u64_le(self.uid);
6496 __tmp.put_u32_le(self.flight_sw_version);
6497 __tmp.put_u32_le(self.middleware_sw_version);
6498 __tmp.put_u32_le(self.os_sw_version);
6499 __tmp.put_u32_le(self.board_version);
6500 __tmp.put_u16_le(self.vendor_id);
6501 __tmp.put_u16_le(self.product_id);
6502 for val in &self.flight_custom_version {
6503 __tmp.put_u8(*val);
6504 }
6505 for val in &self.middleware_custom_version {
6506 __tmp.put_u8(*val);
6507 }
6508 for val in &self.os_custom_version {
6509 __tmp.put_u8(*val);
6510 }
6511 if matches!(version, MavlinkVersion::V2) {
6512 for val in &self.uid2 {
6513 __tmp.put_u8(*val);
6514 }
6515 let len = __tmp.len();
6516 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6517 } else {
6518 __tmp.len()
6519 }
6520 }
6521}
6522#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6523#[doc = ""]
6524#[doc = "ID: 435"]
6525#[derive(Debug, Clone, PartialEq)]
6526#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6527#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6528#[cfg_attr(feature = "ts", derive(TS))]
6529#[cfg_attr(feature = "ts", ts(export))]
6530pub struct AVAILABLE_MODES_DATA {
6531 #[doc = "A bitfield for use for autopilot-specific flags"]
6532 pub custom_mode: u32,
6533 #[doc = "Mode properties."]
6534 pub properties: MavModeProperty,
6535 #[doc = "The total number of available modes for the current vehicle type."]
6536 pub number_modes: u8,
6537 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6538 pub mode_index: u8,
6539 #[doc = "Standard mode."]
6540 pub standard_mode: MavStandardMode,
6541 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6542 #[cfg_attr(
6543 feature = "serde",
6544 serde(
6545 serialize_with = "crate::nulstr::serialize::<_, 35>",
6546 deserialize_with = "crate::nulstr::deserialize::<_, 35>"
6547 )
6548 )]
6549 #[cfg_attr(feature = "ts", ts(type = "string"))]
6550 pub mode_name: [u8; 35],
6551}
6552impl AVAILABLE_MODES_DATA {
6553 pub const ENCODED_LEN: usize = 46usize;
6554 pub const DEFAULT: Self = Self {
6555 custom_mode: 0_u32,
6556 properties: MavModeProperty::DEFAULT,
6557 number_modes: 0_u8,
6558 mode_index: 0_u8,
6559 standard_mode: MavStandardMode::DEFAULT,
6560 mode_name: [0_u8; 35usize],
6561 };
6562 #[cfg(feature = "arbitrary")]
6563 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6564 use arbitrary::{Arbitrary, Unstructured};
6565 let mut buf = [0u8; 1024];
6566 rng.fill_bytes(&mut buf);
6567 let mut unstructured = Unstructured::new(&buf);
6568 Self::arbitrary(&mut unstructured).unwrap_or_default()
6569 }
6570}
6571impl Default for AVAILABLE_MODES_DATA {
6572 fn default() -> Self {
6573 Self::DEFAULT.clone()
6574 }
6575}
6576impl MessageData for AVAILABLE_MODES_DATA {
6577 type Message = MavMessage;
6578 const ID: u32 = 435u32;
6579 const NAME: &'static str = "AVAILABLE_MODES";
6580 const EXTRA_CRC: u8 = 134u8;
6581 const ENCODED_LEN: usize = 46usize;
6582 fn deser(
6583 _version: MavlinkVersion,
6584 __input: &[u8],
6585 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6586 let avail_len = __input.len();
6587 let mut payload_buf = [0; Self::ENCODED_LEN];
6588 let mut buf = if avail_len < Self::ENCODED_LEN {
6589 payload_buf[0..avail_len].copy_from_slice(__input);
6590 Bytes::new(&payload_buf)
6591 } else {
6592 Bytes::new(__input)
6593 };
6594 let mut __struct = Self::default();
6595 __struct.custom_mode = buf.get_u32_le();
6596 let tmp = buf.get_u32_le();
6597 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6598 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6599 flag_type: "MavModeProperty",
6600 value: tmp as u32,
6601 })?;
6602 __struct.number_modes = buf.get_u8();
6603 __struct.mode_index = buf.get_u8();
6604 let tmp = buf.get_u8();
6605 __struct.standard_mode =
6606 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6607 enum_type: "MavStandardMode",
6608 value: tmp as u32,
6609 })?;
6610 for v in &mut __struct.mode_name {
6611 let val = buf.get_u8();
6612 *v = val;
6613 }
6614 Ok(__struct)
6615 }
6616 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6617 let mut __tmp = BytesMut::new(bytes);
6618 #[allow(clippy::absurd_extreme_comparisons)]
6619 #[allow(unused_comparisons)]
6620 if __tmp.remaining() < Self::ENCODED_LEN {
6621 panic!(
6622 "buffer is too small (need {} bytes, but got {})",
6623 Self::ENCODED_LEN,
6624 __tmp.remaining(),
6625 )
6626 }
6627 __tmp.put_u32_le(self.custom_mode);
6628 __tmp.put_u32_le(self.properties.bits());
6629 __tmp.put_u8(self.number_modes);
6630 __tmp.put_u8(self.mode_index);
6631 __tmp.put_u8(self.standard_mode as u8);
6632 for val in &self.mode_name {
6633 __tmp.put_u8(*val);
6634 }
6635 if matches!(version, MavlinkVersion::V2) {
6636 let len = __tmp.len();
6637 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6638 } else {
6639 __tmp.len()
6640 }
6641 }
6642}
6643#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6644#[doc = ""]
6645#[doc = "ID: 437"]
6646#[derive(Debug, Clone, PartialEq)]
6647#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6648#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6649#[cfg_attr(feature = "ts", derive(TS))]
6650#[cfg_attr(feature = "ts", ts(export))]
6651pub struct AVAILABLE_MODES_MONITOR_DATA {
6652 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6653 pub seq: u8,
6654}
6655impl AVAILABLE_MODES_MONITOR_DATA {
6656 pub const ENCODED_LEN: usize = 1usize;
6657 pub const DEFAULT: Self = Self { seq: 0_u8 };
6658 #[cfg(feature = "arbitrary")]
6659 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6660 use arbitrary::{Arbitrary, Unstructured};
6661 let mut buf = [0u8; 1024];
6662 rng.fill_bytes(&mut buf);
6663 let mut unstructured = Unstructured::new(&buf);
6664 Self::arbitrary(&mut unstructured).unwrap_or_default()
6665 }
6666}
6667impl Default for AVAILABLE_MODES_MONITOR_DATA {
6668 fn default() -> Self {
6669 Self::DEFAULT.clone()
6670 }
6671}
6672impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6673 type Message = MavMessage;
6674 const ID: u32 = 437u32;
6675 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6676 const EXTRA_CRC: u8 = 30u8;
6677 const ENCODED_LEN: usize = 1usize;
6678 fn deser(
6679 _version: MavlinkVersion,
6680 __input: &[u8],
6681 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6682 let avail_len = __input.len();
6683 let mut payload_buf = [0; Self::ENCODED_LEN];
6684 let mut buf = if avail_len < Self::ENCODED_LEN {
6685 payload_buf[0..avail_len].copy_from_slice(__input);
6686 Bytes::new(&payload_buf)
6687 } else {
6688 Bytes::new(__input)
6689 };
6690 let mut __struct = Self::default();
6691 __struct.seq = buf.get_u8();
6692 Ok(__struct)
6693 }
6694 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6695 let mut __tmp = BytesMut::new(bytes);
6696 #[allow(clippy::absurd_extreme_comparisons)]
6697 #[allow(unused_comparisons)]
6698 if __tmp.remaining() < Self::ENCODED_LEN {
6699 panic!(
6700 "buffer is too small (need {} bytes, but got {})",
6701 Self::ENCODED_LEN,
6702 __tmp.remaining(),
6703 )
6704 }
6705 __tmp.put_u8(self.seq);
6706 if matches!(version, MavlinkVersion::V2) {
6707 let len = __tmp.len();
6708 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6709 } else {
6710 __tmp.len()
6711 }
6712 }
6713}
6714#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6715#[doc = ""]
6716#[doc = "ID: 372"]
6717#[derive(Debug, Clone, PartialEq)]
6718#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6719#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6720#[cfg_attr(feature = "ts", derive(TS))]
6721#[cfg_attr(feature = "ts", ts(export))]
6722pub struct BATTERY_INFO_DATA {
6723 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6724 pub discharge_minimum_voltage: f32,
6725 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6726 pub charging_minimum_voltage: f32,
6727 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6728 pub resting_minimum_voltage: f32,
6729 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6730 pub charging_maximum_voltage: f32,
6731 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6732 pub charging_maximum_current: f32,
6733 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6734 pub nominal_voltage: f32,
6735 #[doc = "Maximum pack discharge current. 0: field not provided."]
6736 pub discharge_maximum_current: f32,
6737 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6738 pub discharge_maximum_burst_current: f32,
6739 #[doc = "Fully charged design capacity. 0: field not provided."]
6740 pub design_capacity: f32,
6741 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6742 pub full_charge_capacity: f32,
6743 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6744 pub cycle_count: u16,
6745 #[doc = "Battery weight. 0: field not provided."]
6746 pub weight: u16,
6747 #[doc = "Battery ID"]
6748 pub id: u8,
6749 #[doc = "Function of the battery."]
6750 pub battery_function: MavBatteryFunction,
6751 #[doc = "Type (chemistry) of the battery."]
6752 pub mavtype: MavBatteryType,
6753 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6754 pub state_of_health: u8,
6755 #[doc = "Number of battery cells in series. 0: field not provided."]
6756 pub cells_in_series: u8,
6757 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6758 #[cfg_attr(
6759 feature = "serde",
6760 serde(
6761 serialize_with = "crate::nulstr::serialize::<_, 9>",
6762 deserialize_with = "crate::nulstr::deserialize::<_, 9>"
6763 )
6764 )]
6765 #[cfg_attr(feature = "ts", ts(type = "string"))]
6766 pub manufacture_date: [u8; 9],
6767 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6768 #[cfg_attr(
6769 feature = "serde",
6770 serde(
6771 serialize_with = "crate::nulstr::serialize::<_, 32>",
6772 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
6773 )
6774 )]
6775 #[cfg_attr(feature = "ts", ts(type = "string"))]
6776 pub serial_number: [u8; 32],
6777 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6778 #[cfg_attr(
6779 feature = "serde",
6780 serde(
6781 serialize_with = "crate::nulstr::serialize::<_, 50>",
6782 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
6783 )
6784 )]
6785 #[cfg_attr(feature = "ts", ts(type = "string"))]
6786 pub name: [u8; 50],
6787}
6788impl BATTERY_INFO_DATA {
6789 pub const ENCODED_LEN: usize = 140usize;
6790 pub const DEFAULT: Self = Self {
6791 discharge_minimum_voltage: 0.0_f32,
6792 charging_minimum_voltage: 0.0_f32,
6793 resting_minimum_voltage: 0.0_f32,
6794 charging_maximum_voltage: 0.0_f32,
6795 charging_maximum_current: 0.0_f32,
6796 nominal_voltage: 0.0_f32,
6797 discharge_maximum_current: 0.0_f32,
6798 discharge_maximum_burst_current: 0.0_f32,
6799 design_capacity: 0.0_f32,
6800 full_charge_capacity: 0.0_f32,
6801 cycle_count: 0_u16,
6802 weight: 0_u16,
6803 id: 0_u8,
6804 battery_function: MavBatteryFunction::DEFAULT,
6805 mavtype: MavBatteryType::DEFAULT,
6806 state_of_health: 0_u8,
6807 cells_in_series: 0_u8,
6808 manufacture_date: [0_u8; 9usize],
6809 serial_number: [0_u8; 32usize],
6810 name: [0_u8; 50usize],
6811 };
6812 #[cfg(feature = "arbitrary")]
6813 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6814 use arbitrary::{Arbitrary, Unstructured};
6815 let mut buf = [0u8; 1024];
6816 rng.fill_bytes(&mut buf);
6817 let mut unstructured = Unstructured::new(&buf);
6818 Self::arbitrary(&mut unstructured).unwrap_or_default()
6819 }
6820}
6821impl Default for BATTERY_INFO_DATA {
6822 fn default() -> Self {
6823 Self::DEFAULT.clone()
6824 }
6825}
6826impl MessageData for BATTERY_INFO_DATA {
6827 type Message = MavMessage;
6828 const ID: u32 = 372u32;
6829 const NAME: &'static str = "BATTERY_INFO";
6830 const EXTRA_CRC: u8 = 26u8;
6831 const ENCODED_LEN: usize = 140usize;
6832 fn deser(
6833 _version: MavlinkVersion,
6834 __input: &[u8],
6835 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6836 let avail_len = __input.len();
6837 let mut payload_buf = [0; Self::ENCODED_LEN];
6838 let mut buf = if avail_len < Self::ENCODED_LEN {
6839 payload_buf[0..avail_len].copy_from_slice(__input);
6840 Bytes::new(&payload_buf)
6841 } else {
6842 Bytes::new(__input)
6843 };
6844 let mut __struct = Self::default();
6845 __struct.discharge_minimum_voltage = buf.get_f32_le();
6846 __struct.charging_minimum_voltage = buf.get_f32_le();
6847 __struct.resting_minimum_voltage = buf.get_f32_le();
6848 __struct.charging_maximum_voltage = buf.get_f32_le();
6849 __struct.charging_maximum_current = buf.get_f32_le();
6850 __struct.nominal_voltage = buf.get_f32_le();
6851 __struct.discharge_maximum_current = buf.get_f32_le();
6852 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6853 __struct.design_capacity = buf.get_f32_le();
6854 __struct.full_charge_capacity = buf.get_f32_le();
6855 __struct.cycle_count = buf.get_u16_le();
6856 __struct.weight = buf.get_u16_le();
6857 __struct.id = buf.get_u8();
6858 let tmp = buf.get_u8();
6859 __struct.battery_function =
6860 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6861 enum_type: "MavBatteryFunction",
6862 value: tmp as u32,
6863 })?;
6864 let tmp = buf.get_u8();
6865 __struct.mavtype =
6866 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6867 enum_type: "MavBatteryType",
6868 value: tmp as u32,
6869 })?;
6870 __struct.state_of_health = buf.get_u8();
6871 __struct.cells_in_series = buf.get_u8();
6872 for v in &mut __struct.manufacture_date {
6873 let val = buf.get_u8();
6874 *v = val;
6875 }
6876 for v in &mut __struct.serial_number {
6877 let val = buf.get_u8();
6878 *v = val;
6879 }
6880 for v in &mut __struct.name {
6881 let val = buf.get_u8();
6882 *v = val;
6883 }
6884 Ok(__struct)
6885 }
6886 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6887 let mut __tmp = BytesMut::new(bytes);
6888 #[allow(clippy::absurd_extreme_comparisons)]
6889 #[allow(unused_comparisons)]
6890 if __tmp.remaining() < Self::ENCODED_LEN {
6891 panic!(
6892 "buffer is too small (need {} bytes, but got {})",
6893 Self::ENCODED_LEN,
6894 __tmp.remaining(),
6895 )
6896 }
6897 __tmp.put_f32_le(self.discharge_minimum_voltage);
6898 __tmp.put_f32_le(self.charging_minimum_voltage);
6899 __tmp.put_f32_le(self.resting_minimum_voltage);
6900 __tmp.put_f32_le(self.charging_maximum_voltage);
6901 __tmp.put_f32_le(self.charging_maximum_current);
6902 __tmp.put_f32_le(self.nominal_voltage);
6903 __tmp.put_f32_le(self.discharge_maximum_current);
6904 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6905 __tmp.put_f32_le(self.design_capacity);
6906 __tmp.put_f32_le(self.full_charge_capacity);
6907 __tmp.put_u16_le(self.cycle_count);
6908 __tmp.put_u16_le(self.weight);
6909 __tmp.put_u8(self.id);
6910 __tmp.put_u8(self.battery_function as u8);
6911 __tmp.put_u8(self.mavtype as u8);
6912 __tmp.put_u8(self.state_of_health);
6913 __tmp.put_u8(self.cells_in_series);
6914 for val in &self.manufacture_date {
6915 __tmp.put_u8(*val);
6916 }
6917 for val in &self.serial_number {
6918 __tmp.put_u8(*val);
6919 }
6920 for val in &self.name {
6921 __tmp.put_u8(*val);
6922 }
6923 if matches!(version, MavlinkVersion::V2) {
6924 let len = __tmp.len();
6925 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6926 } else {
6927 __tmp.len()
6928 }
6929 }
6930}
6931#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6932#[doc = ""]
6933#[doc = "ID: 147"]
6934#[derive(Debug, Clone, PartialEq)]
6935#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6936#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6937#[cfg_attr(feature = "ts", derive(TS))]
6938#[cfg_attr(feature = "ts", ts(export))]
6939pub struct BATTERY_STATUS_DATA {
6940 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6941 pub current_consumed: i32,
6942 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6943 pub energy_consumed: i32,
6944 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6945 pub temperature: i16,
6946 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6947 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6948 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6949 pub voltages: [u16; 10],
6950 #[doc = "Battery current, -1: autopilot does not measure the current"]
6951 pub current_battery: i16,
6952 #[doc = "Battery ID"]
6953 pub id: u8,
6954 #[doc = "Function of the battery"]
6955 pub battery_function: MavBatteryFunction,
6956 #[doc = "Type (chemistry) of the battery"]
6957 pub mavtype: MavBatteryType,
6958 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6959 pub battery_remaining: i8,
6960 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6961 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6962 pub time_remaining: i32,
6963 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6964 #[cfg_attr(feature = "serde", serde(default))]
6965 pub charge_state: MavBatteryChargeState,
6966 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6967 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6968 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6969 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6970 pub voltages_ext: [u16; 4],
6971 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6972 #[cfg_attr(feature = "serde", serde(default))]
6973 pub mode: MavBatteryMode,
6974 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6975 #[cfg_attr(feature = "serde", serde(default))]
6976 pub fault_bitmask: MavBatteryFault,
6977}
6978impl BATTERY_STATUS_DATA {
6979 pub const ENCODED_LEN: usize = 54usize;
6980 pub const DEFAULT: Self = Self {
6981 current_consumed: 0_i32,
6982 energy_consumed: 0_i32,
6983 temperature: 0_i16,
6984 voltages: [0_u16; 10usize],
6985 current_battery: 0_i16,
6986 id: 0_u8,
6987 battery_function: MavBatteryFunction::DEFAULT,
6988 mavtype: MavBatteryType::DEFAULT,
6989 battery_remaining: 0_i8,
6990 time_remaining: 0_i32,
6991 charge_state: MavBatteryChargeState::DEFAULT,
6992 voltages_ext: [0_u16; 4usize],
6993 mode: MavBatteryMode::DEFAULT,
6994 fault_bitmask: MavBatteryFault::DEFAULT,
6995 };
6996 #[cfg(feature = "arbitrary")]
6997 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6998 use arbitrary::{Arbitrary, Unstructured};
6999 let mut buf = [0u8; 1024];
7000 rng.fill_bytes(&mut buf);
7001 let mut unstructured = Unstructured::new(&buf);
7002 Self::arbitrary(&mut unstructured).unwrap_or_default()
7003 }
7004}
7005impl Default for BATTERY_STATUS_DATA {
7006 fn default() -> Self {
7007 Self::DEFAULT.clone()
7008 }
7009}
7010impl MessageData for BATTERY_STATUS_DATA {
7011 type Message = MavMessage;
7012 const ID: u32 = 147u32;
7013 const NAME: &'static str = "BATTERY_STATUS";
7014 const EXTRA_CRC: u8 = 154u8;
7015 const ENCODED_LEN: usize = 54usize;
7016 fn deser(
7017 _version: MavlinkVersion,
7018 __input: &[u8],
7019 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7020 let avail_len = __input.len();
7021 let mut payload_buf = [0; Self::ENCODED_LEN];
7022 let mut buf = if avail_len < Self::ENCODED_LEN {
7023 payload_buf[0..avail_len].copy_from_slice(__input);
7024 Bytes::new(&payload_buf)
7025 } else {
7026 Bytes::new(__input)
7027 };
7028 let mut __struct = Self::default();
7029 __struct.current_consumed = buf.get_i32_le();
7030 __struct.energy_consumed = buf.get_i32_le();
7031 __struct.temperature = buf.get_i16_le();
7032 for v in &mut __struct.voltages {
7033 let val = buf.get_u16_le();
7034 *v = val;
7035 }
7036 __struct.current_battery = buf.get_i16_le();
7037 __struct.id = buf.get_u8();
7038 let tmp = buf.get_u8();
7039 __struct.battery_function =
7040 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7041 enum_type: "MavBatteryFunction",
7042 value: tmp as u32,
7043 })?;
7044 let tmp = buf.get_u8();
7045 __struct.mavtype =
7046 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7047 enum_type: "MavBatteryType",
7048 value: tmp as u32,
7049 })?;
7050 __struct.battery_remaining = buf.get_i8();
7051 __struct.time_remaining = buf.get_i32_le();
7052 let tmp = buf.get_u8();
7053 __struct.charge_state =
7054 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7055 enum_type: "MavBatteryChargeState",
7056 value: tmp as u32,
7057 })?;
7058 for v in &mut __struct.voltages_ext {
7059 let val = buf.get_u16_le();
7060 *v = val;
7061 }
7062 let tmp = buf.get_u8();
7063 __struct.mode =
7064 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7065 enum_type: "MavBatteryMode",
7066 value: tmp as u32,
7067 })?;
7068 let tmp = buf.get_u32_le();
7069 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
7070 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7071 flag_type: "MavBatteryFault",
7072 value: tmp as u32,
7073 })?;
7074 Ok(__struct)
7075 }
7076 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7077 let mut __tmp = BytesMut::new(bytes);
7078 #[allow(clippy::absurd_extreme_comparisons)]
7079 #[allow(unused_comparisons)]
7080 if __tmp.remaining() < Self::ENCODED_LEN {
7081 panic!(
7082 "buffer is too small (need {} bytes, but got {})",
7083 Self::ENCODED_LEN,
7084 __tmp.remaining(),
7085 )
7086 }
7087 __tmp.put_i32_le(self.current_consumed);
7088 __tmp.put_i32_le(self.energy_consumed);
7089 __tmp.put_i16_le(self.temperature);
7090 for val in &self.voltages {
7091 __tmp.put_u16_le(*val);
7092 }
7093 __tmp.put_i16_le(self.current_battery);
7094 __tmp.put_u8(self.id);
7095 __tmp.put_u8(self.battery_function as u8);
7096 __tmp.put_u8(self.mavtype as u8);
7097 __tmp.put_i8(self.battery_remaining);
7098 if matches!(version, MavlinkVersion::V2) {
7099 __tmp.put_i32_le(self.time_remaining);
7100 __tmp.put_u8(self.charge_state as u8);
7101 for val in &self.voltages_ext {
7102 __tmp.put_u16_le(*val);
7103 }
7104 __tmp.put_u8(self.mode as u8);
7105 __tmp.put_u32_le(self.fault_bitmask.bits());
7106 let len = __tmp.len();
7107 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7108 } else {
7109 __tmp.len()
7110 }
7111 }
7112}
7113#[doc = "Report button state change."]
7114#[doc = ""]
7115#[doc = "ID: 257"]
7116#[derive(Debug, Clone, PartialEq)]
7117#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7118#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7119#[cfg_attr(feature = "ts", derive(TS))]
7120#[cfg_attr(feature = "ts", ts(export))]
7121pub struct BUTTON_CHANGE_DATA {
7122 #[doc = "Timestamp (time since system boot)."]
7123 pub time_boot_ms: u32,
7124 #[doc = "Time of last change of button state."]
7125 pub last_change_ms: u32,
7126 #[doc = "Bitmap for state of buttons."]
7127 pub state: u8,
7128}
7129impl BUTTON_CHANGE_DATA {
7130 pub const ENCODED_LEN: usize = 9usize;
7131 pub const DEFAULT: Self = Self {
7132 time_boot_ms: 0_u32,
7133 last_change_ms: 0_u32,
7134 state: 0_u8,
7135 };
7136 #[cfg(feature = "arbitrary")]
7137 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7138 use arbitrary::{Arbitrary, Unstructured};
7139 let mut buf = [0u8; 1024];
7140 rng.fill_bytes(&mut buf);
7141 let mut unstructured = Unstructured::new(&buf);
7142 Self::arbitrary(&mut unstructured).unwrap_or_default()
7143 }
7144}
7145impl Default for BUTTON_CHANGE_DATA {
7146 fn default() -> Self {
7147 Self::DEFAULT.clone()
7148 }
7149}
7150impl MessageData for BUTTON_CHANGE_DATA {
7151 type Message = MavMessage;
7152 const ID: u32 = 257u32;
7153 const NAME: &'static str = "BUTTON_CHANGE";
7154 const EXTRA_CRC: u8 = 131u8;
7155 const ENCODED_LEN: usize = 9usize;
7156 fn deser(
7157 _version: MavlinkVersion,
7158 __input: &[u8],
7159 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7160 let avail_len = __input.len();
7161 let mut payload_buf = [0; Self::ENCODED_LEN];
7162 let mut buf = if avail_len < Self::ENCODED_LEN {
7163 payload_buf[0..avail_len].copy_from_slice(__input);
7164 Bytes::new(&payload_buf)
7165 } else {
7166 Bytes::new(__input)
7167 };
7168 let mut __struct = Self::default();
7169 __struct.time_boot_ms = buf.get_u32_le();
7170 __struct.last_change_ms = buf.get_u32_le();
7171 __struct.state = buf.get_u8();
7172 Ok(__struct)
7173 }
7174 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7175 let mut __tmp = BytesMut::new(bytes);
7176 #[allow(clippy::absurd_extreme_comparisons)]
7177 #[allow(unused_comparisons)]
7178 if __tmp.remaining() < Self::ENCODED_LEN {
7179 panic!(
7180 "buffer is too small (need {} bytes, but got {})",
7181 Self::ENCODED_LEN,
7182 __tmp.remaining(),
7183 )
7184 }
7185 __tmp.put_u32_le(self.time_boot_ms);
7186 __tmp.put_u32_le(self.last_change_ms);
7187 __tmp.put_u8(self.state);
7188 if matches!(version, MavlinkVersion::V2) {
7189 let len = __tmp.len();
7190 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7191 } else {
7192 __tmp.len()
7193 }
7194 }
7195}
7196#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7197#[doc = ""]
7198#[doc = "ID: 262"]
7199#[derive(Debug, Clone, PartialEq)]
7200#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7201#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7202#[cfg_attr(feature = "ts", derive(TS))]
7203#[cfg_attr(feature = "ts", ts(export))]
7204pub struct CAMERA_CAPTURE_STATUS_DATA {
7205 #[doc = "Timestamp (time since system boot)."]
7206 pub time_boot_ms: u32,
7207 #[doc = "Image capture interval"]
7208 pub image_interval: f32,
7209 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
7210 pub recording_time_ms: u32,
7211 #[doc = "Available storage capacity."]
7212 pub available_capacity: f32,
7213 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
7214 pub image_status: u8,
7215 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
7216 pub video_status: u8,
7217 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
7218 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7219 pub image_count: i32,
7220 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7221 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7222 pub camera_device_id: u8,
7223}
7224impl CAMERA_CAPTURE_STATUS_DATA {
7225 pub const ENCODED_LEN: usize = 23usize;
7226 pub const DEFAULT: Self = Self {
7227 time_boot_ms: 0_u32,
7228 image_interval: 0.0_f32,
7229 recording_time_ms: 0_u32,
7230 available_capacity: 0.0_f32,
7231 image_status: 0_u8,
7232 video_status: 0_u8,
7233 image_count: 0_i32,
7234 camera_device_id: 0_u8,
7235 };
7236 #[cfg(feature = "arbitrary")]
7237 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7238 use arbitrary::{Arbitrary, Unstructured};
7239 let mut buf = [0u8; 1024];
7240 rng.fill_bytes(&mut buf);
7241 let mut unstructured = Unstructured::new(&buf);
7242 Self::arbitrary(&mut unstructured).unwrap_or_default()
7243 }
7244}
7245impl Default for CAMERA_CAPTURE_STATUS_DATA {
7246 fn default() -> Self {
7247 Self::DEFAULT.clone()
7248 }
7249}
7250impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
7251 type Message = MavMessage;
7252 const ID: u32 = 262u32;
7253 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
7254 const EXTRA_CRC: u8 = 12u8;
7255 const ENCODED_LEN: usize = 23usize;
7256 fn deser(
7257 _version: MavlinkVersion,
7258 __input: &[u8],
7259 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7260 let avail_len = __input.len();
7261 let mut payload_buf = [0; Self::ENCODED_LEN];
7262 let mut buf = if avail_len < Self::ENCODED_LEN {
7263 payload_buf[0..avail_len].copy_from_slice(__input);
7264 Bytes::new(&payload_buf)
7265 } else {
7266 Bytes::new(__input)
7267 };
7268 let mut __struct = Self::default();
7269 __struct.time_boot_ms = buf.get_u32_le();
7270 __struct.image_interval = buf.get_f32_le();
7271 __struct.recording_time_ms = buf.get_u32_le();
7272 __struct.available_capacity = buf.get_f32_le();
7273 __struct.image_status = buf.get_u8();
7274 __struct.video_status = buf.get_u8();
7275 __struct.image_count = buf.get_i32_le();
7276 __struct.camera_device_id = buf.get_u8();
7277 Ok(__struct)
7278 }
7279 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7280 let mut __tmp = BytesMut::new(bytes);
7281 #[allow(clippy::absurd_extreme_comparisons)]
7282 #[allow(unused_comparisons)]
7283 if __tmp.remaining() < Self::ENCODED_LEN {
7284 panic!(
7285 "buffer is too small (need {} bytes, but got {})",
7286 Self::ENCODED_LEN,
7287 __tmp.remaining(),
7288 )
7289 }
7290 __tmp.put_u32_le(self.time_boot_ms);
7291 __tmp.put_f32_le(self.image_interval);
7292 __tmp.put_u32_le(self.recording_time_ms);
7293 __tmp.put_f32_le(self.available_capacity);
7294 __tmp.put_u8(self.image_status);
7295 __tmp.put_u8(self.video_status);
7296 if matches!(version, MavlinkVersion::V2) {
7297 __tmp.put_i32_le(self.image_count);
7298 __tmp.put_u8(self.camera_device_id);
7299 let len = __tmp.len();
7300 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7301 } else {
7302 __tmp.len()
7303 }
7304 }
7305}
7306#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7307#[doc = ""]
7308#[doc = "ID: 271"]
7309#[derive(Debug, Clone, PartialEq)]
7310#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7311#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7312#[cfg_attr(feature = "ts", derive(TS))]
7313#[cfg_attr(feature = "ts", ts(export))]
7314pub struct CAMERA_FOV_STATUS_DATA {
7315 #[doc = "Timestamp (time since system boot)."]
7316 pub time_boot_ms: u32,
7317 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7318 pub lat_camera: i32,
7319 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7320 pub lon_camera: i32,
7321 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7322 pub alt_camera: i32,
7323 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7324 pub lat_image: i32,
7325 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7326 pub lon_image: i32,
7327 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7328 pub alt_image: i32,
7329 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7330 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7331 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7332 pub q: [f32; 4],
7333 #[doc = "Horizontal field of view (NaN if unknown)."]
7334 pub hfov: f32,
7335 #[doc = "Vertical field of view (NaN if unknown)."]
7336 pub vfov: f32,
7337 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7338 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7339 pub camera_device_id: u8,
7340}
7341impl CAMERA_FOV_STATUS_DATA {
7342 pub const ENCODED_LEN: usize = 53usize;
7343 pub const DEFAULT: Self = Self {
7344 time_boot_ms: 0_u32,
7345 lat_camera: 0_i32,
7346 lon_camera: 0_i32,
7347 alt_camera: 0_i32,
7348 lat_image: 0_i32,
7349 lon_image: 0_i32,
7350 alt_image: 0_i32,
7351 q: [0.0_f32; 4usize],
7352 hfov: 0.0_f32,
7353 vfov: 0.0_f32,
7354 camera_device_id: 0_u8,
7355 };
7356 #[cfg(feature = "arbitrary")]
7357 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7358 use arbitrary::{Arbitrary, Unstructured};
7359 let mut buf = [0u8; 1024];
7360 rng.fill_bytes(&mut buf);
7361 let mut unstructured = Unstructured::new(&buf);
7362 Self::arbitrary(&mut unstructured).unwrap_or_default()
7363 }
7364}
7365impl Default for CAMERA_FOV_STATUS_DATA {
7366 fn default() -> Self {
7367 Self::DEFAULT.clone()
7368 }
7369}
7370impl MessageData for CAMERA_FOV_STATUS_DATA {
7371 type Message = MavMessage;
7372 const ID: u32 = 271u32;
7373 const NAME: &'static str = "CAMERA_FOV_STATUS";
7374 const EXTRA_CRC: u8 = 22u8;
7375 const ENCODED_LEN: usize = 53usize;
7376 fn deser(
7377 _version: MavlinkVersion,
7378 __input: &[u8],
7379 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7380 let avail_len = __input.len();
7381 let mut payload_buf = [0; Self::ENCODED_LEN];
7382 let mut buf = if avail_len < Self::ENCODED_LEN {
7383 payload_buf[0..avail_len].copy_from_slice(__input);
7384 Bytes::new(&payload_buf)
7385 } else {
7386 Bytes::new(__input)
7387 };
7388 let mut __struct = Self::default();
7389 __struct.time_boot_ms = buf.get_u32_le();
7390 __struct.lat_camera = buf.get_i32_le();
7391 __struct.lon_camera = buf.get_i32_le();
7392 __struct.alt_camera = buf.get_i32_le();
7393 __struct.lat_image = buf.get_i32_le();
7394 __struct.lon_image = buf.get_i32_le();
7395 __struct.alt_image = buf.get_i32_le();
7396 for v in &mut __struct.q {
7397 let val = buf.get_f32_le();
7398 *v = val;
7399 }
7400 __struct.hfov = buf.get_f32_le();
7401 __struct.vfov = buf.get_f32_le();
7402 __struct.camera_device_id = buf.get_u8();
7403 Ok(__struct)
7404 }
7405 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7406 let mut __tmp = BytesMut::new(bytes);
7407 #[allow(clippy::absurd_extreme_comparisons)]
7408 #[allow(unused_comparisons)]
7409 if __tmp.remaining() < Self::ENCODED_LEN {
7410 panic!(
7411 "buffer is too small (need {} bytes, but got {})",
7412 Self::ENCODED_LEN,
7413 __tmp.remaining(),
7414 )
7415 }
7416 __tmp.put_u32_le(self.time_boot_ms);
7417 __tmp.put_i32_le(self.lat_camera);
7418 __tmp.put_i32_le(self.lon_camera);
7419 __tmp.put_i32_le(self.alt_camera);
7420 __tmp.put_i32_le(self.lat_image);
7421 __tmp.put_i32_le(self.lon_image);
7422 __tmp.put_i32_le(self.alt_image);
7423 for val in &self.q {
7424 __tmp.put_f32_le(*val);
7425 }
7426 __tmp.put_f32_le(self.hfov);
7427 __tmp.put_f32_le(self.vfov);
7428 if matches!(version, MavlinkVersion::V2) {
7429 __tmp.put_u8(self.camera_device_id);
7430 let len = __tmp.len();
7431 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7432 } else {
7433 __tmp.len()
7434 }
7435 }
7436}
7437#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7438#[doc = ""]
7439#[doc = "ID: 263"]
7440#[derive(Debug, Clone, PartialEq)]
7441#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7442#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7443#[cfg_attr(feature = "ts", derive(TS))]
7444#[cfg_attr(feature = "ts", ts(export))]
7445pub struct CAMERA_IMAGE_CAPTURED_DATA {
7446 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7447 pub time_utc: u64,
7448 #[doc = "Timestamp (time since system boot)."]
7449 pub time_boot_ms: u32,
7450 #[doc = "Latitude where image was taken"]
7451 pub lat: i32,
7452 #[doc = "Longitude where capture was taken"]
7453 pub lon: i32,
7454 #[doc = "Altitude (MSL) where image was taken"]
7455 pub alt: i32,
7456 #[doc = "Altitude above ground"]
7457 pub relative_alt: i32,
7458 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7459 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7460 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7461 pub q: [f32; 4],
7462 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7463 pub image_index: i32,
7464 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7465 pub camera_id: u8,
7466 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7467 pub capture_result: i8,
7468 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7469 #[cfg_attr(
7470 feature = "serde",
7471 serde(
7472 serialize_with = "crate::nulstr::serialize::<_, 205>",
7473 deserialize_with = "crate::nulstr::deserialize::<_, 205>"
7474 )
7475 )]
7476 #[cfg_attr(feature = "ts", ts(type = "string"))]
7477 pub file_url: [u8; 205],
7478}
7479impl CAMERA_IMAGE_CAPTURED_DATA {
7480 pub const ENCODED_LEN: usize = 255usize;
7481 pub const DEFAULT: Self = Self {
7482 time_utc: 0_u64,
7483 time_boot_ms: 0_u32,
7484 lat: 0_i32,
7485 lon: 0_i32,
7486 alt: 0_i32,
7487 relative_alt: 0_i32,
7488 q: [0.0_f32; 4usize],
7489 image_index: 0_i32,
7490 camera_id: 0_u8,
7491 capture_result: 0_i8,
7492 file_url: [0_u8; 205usize],
7493 };
7494 #[cfg(feature = "arbitrary")]
7495 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7496 use arbitrary::{Arbitrary, Unstructured};
7497 let mut buf = [0u8; 1024];
7498 rng.fill_bytes(&mut buf);
7499 let mut unstructured = Unstructured::new(&buf);
7500 Self::arbitrary(&mut unstructured).unwrap_or_default()
7501 }
7502}
7503impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7504 fn default() -> Self {
7505 Self::DEFAULT.clone()
7506 }
7507}
7508impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7509 type Message = MavMessage;
7510 const ID: u32 = 263u32;
7511 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7512 const EXTRA_CRC: u8 = 133u8;
7513 const ENCODED_LEN: usize = 255usize;
7514 fn deser(
7515 _version: MavlinkVersion,
7516 __input: &[u8],
7517 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7518 let avail_len = __input.len();
7519 let mut payload_buf = [0; Self::ENCODED_LEN];
7520 let mut buf = if avail_len < Self::ENCODED_LEN {
7521 payload_buf[0..avail_len].copy_from_slice(__input);
7522 Bytes::new(&payload_buf)
7523 } else {
7524 Bytes::new(__input)
7525 };
7526 let mut __struct = Self::default();
7527 __struct.time_utc = buf.get_u64_le();
7528 __struct.time_boot_ms = buf.get_u32_le();
7529 __struct.lat = buf.get_i32_le();
7530 __struct.lon = buf.get_i32_le();
7531 __struct.alt = buf.get_i32_le();
7532 __struct.relative_alt = buf.get_i32_le();
7533 for v in &mut __struct.q {
7534 let val = buf.get_f32_le();
7535 *v = val;
7536 }
7537 __struct.image_index = buf.get_i32_le();
7538 __struct.camera_id = buf.get_u8();
7539 __struct.capture_result = buf.get_i8();
7540 for v in &mut __struct.file_url {
7541 let val = buf.get_u8();
7542 *v = val;
7543 }
7544 Ok(__struct)
7545 }
7546 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7547 let mut __tmp = BytesMut::new(bytes);
7548 #[allow(clippy::absurd_extreme_comparisons)]
7549 #[allow(unused_comparisons)]
7550 if __tmp.remaining() < Self::ENCODED_LEN {
7551 panic!(
7552 "buffer is too small (need {} bytes, but got {})",
7553 Self::ENCODED_LEN,
7554 __tmp.remaining(),
7555 )
7556 }
7557 __tmp.put_u64_le(self.time_utc);
7558 __tmp.put_u32_le(self.time_boot_ms);
7559 __tmp.put_i32_le(self.lat);
7560 __tmp.put_i32_le(self.lon);
7561 __tmp.put_i32_le(self.alt);
7562 __tmp.put_i32_le(self.relative_alt);
7563 for val in &self.q {
7564 __tmp.put_f32_le(*val);
7565 }
7566 __tmp.put_i32_le(self.image_index);
7567 __tmp.put_u8(self.camera_id);
7568 __tmp.put_i8(self.capture_result);
7569 for val in &self.file_url {
7570 __tmp.put_u8(*val);
7571 }
7572 if matches!(version, MavlinkVersion::V2) {
7573 let len = __tmp.len();
7574 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7575 } else {
7576 __tmp.len()
7577 }
7578 }
7579}
7580#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7581#[doc = ""]
7582#[doc = "ID: 259"]
7583#[derive(Debug, Clone, PartialEq)]
7584#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7585#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7586#[cfg_attr(feature = "ts", derive(TS))]
7587#[cfg_attr(feature = "ts", ts(export))]
7588pub struct CAMERA_INFORMATION_DATA {
7589 #[doc = "Timestamp (time since system boot)."]
7590 pub time_boot_ms: u32,
7591 #[doc = "0xff). Use 0 if not known."]
7592 pub firmware_version: u32,
7593 #[doc = "Focal length. Use NaN if not known."]
7594 pub focal_length: f32,
7595 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7596 pub sensor_size_h: f32,
7597 #[doc = "Image sensor size vertical. Use NaN if not known."]
7598 pub sensor_size_v: f32,
7599 #[doc = "Bitmap of camera capability flags."]
7600 pub flags: CameraCapFlags,
7601 #[doc = "Horizontal image resolution. Use 0 if not known."]
7602 pub resolution_h: u16,
7603 #[doc = "Vertical image resolution. Use 0 if not known."]
7604 pub resolution_v: u16,
7605 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7606 pub cam_definition_version: u16,
7607 #[doc = "Name of the camera vendor"]
7608 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7609 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7610 pub vendor_name: [u8; 32],
7611 #[doc = "Name of the camera model"]
7612 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7613 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7614 pub model_name: [u8; 32],
7615 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7616 pub lens_id: u8,
7617 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7618 #[cfg_attr(
7619 feature = "serde",
7620 serde(
7621 serialize_with = "crate::nulstr::serialize::<_, 140>",
7622 deserialize_with = "crate::nulstr::deserialize::<_, 140>"
7623 )
7624 )]
7625 #[cfg_attr(feature = "ts", ts(type = "string"))]
7626 pub cam_definition_uri: [u8; 140],
7627 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7628 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7629 pub gimbal_device_id: u8,
7630 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7631 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7632 pub camera_device_id: u8,
7633}
7634impl CAMERA_INFORMATION_DATA {
7635 pub const ENCODED_LEN: usize = 237usize;
7636 pub const DEFAULT: Self = Self {
7637 time_boot_ms: 0_u32,
7638 firmware_version: 0_u32,
7639 focal_length: 0.0_f32,
7640 sensor_size_h: 0.0_f32,
7641 sensor_size_v: 0.0_f32,
7642 flags: CameraCapFlags::DEFAULT,
7643 resolution_h: 0_u16,
7644 resolution_v: 0_u16,
7645 cam_definition_version: 0_u16,
7646 vendor_name: [0_u8; 32usize],
7647 model_name: [0_u8; 32usize],
7648 lens_id: 0_u8,
7649 cam_definition_uri: [0_u8; 140usize],
7650 gimbal_device_id: 0_u8,
7651 camera_device_id: 0_u8,
7652 };
7653 #[cfg(feature = "arbitrary")]
7654 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7655 use arbitrary::{Arbitrary, Unstructured};
7656 let mut buf = [0u8; 1024];
7657 rng.fill_bytes(&mut buf);
7658 let mut unstructured = Unstructured::new(&buf);
7659 Self::arbitrary(&mut unstructured).unwrap_or_default()
7660 }
7661}
7662impl Default for CAMERA_INFORMATION_DATA {
7663 fn default() -> Self {
7664 Self::DEFAULT.clone()
7665 }
7666}
7667impl MessageData for CAMERA_INFORMATION_DATA {
7668 type Message = MavMessage;
7669 const ID: u32 = 259u32;
7670 const NAME: &'static str = "CAMERA_INFORMATION";
7671 const EXTRA_CRC: u8 = 92u8;
7672 const ENCODED_LEN: usize = 237usize;
7673 fn deser(
7674 _version: MavlinkVersion,
7675 __input: &[u8],
7676 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7677 let avail_len = __input.len();
7678 let mut payload_buf = [0; Self::ENCODED_LEN];
7679 let mut buf = if avail_len < Self::ENCODED_LEN {
7680 payload_buf[0..avail_len].copy_from_slice(__input);
7681 Bytes::new(&payload_buf)
7682 } else {
7683 Bytes::new(__input)
7684 };
7685 let mut __struct = Self::default();
7686 __struct.time_boot_ms = buf.get_u32_le();
7687 __struct.firmware_version = buf.get_u32_le();
7688 __struct.focal_length = buf.get_f32_le();
7689 __struct.sensor_size_h = buf.get_f32_le();
7690 __struct.sensor_size_v = buf.get_f32_le();
7691 let tmp = buf.get_u32_le();
7692 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7693 ::mavlink_core::error::ParserError::InvalidFlag {
7694 flag_type: "CameraCapFlags",
7695 value: tmp as u32,
7696 },
7697 )?;
7698 __struct.resolution_h = buf.get_u16_le();
7699 __struct.resolution_v = buf.get_u16_le();
7700 __struct.cam_definition_version = buf.get_u16_le();
7701 for v in &mut __struct.vendor_name {
7702 let val = buf.get_u8();
7703 *v = val;
7704 }
7705 for v in &mut __struct.model_name {
7706 let val = buf.get_u8();
7707 *v = val;
7708 }
7709 __struct.lens_id = buf.get_u8();
7710 for v in &mut __struct.cam_definition_uri {
7711 let val = buf.get_u8();
7712 *v = val;
7713 }
7714 __struct.gimbal_device_id = buf.get_u8();
7715 __struct.camera_device_id = buf.get_u8();
7716 Ok(__struct)
7717 }
7718 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7719 let mut __tmp = BytesMut::new(bytes);
7720 #[allow(clippy::absurd_extreme_comparisons)]
7721 #[allow(unused_comparisons)]
7722 if __tmp.remaining() < Self::ENCODED_LEN {
7723 panic!(
7724 "buffer is too small (need {} bytes, but got {})",
7725 Self::ENCODED_LEN,
7726 __tmp.remaining(),
7727 )
7728 }
7729 __tmp.put_u32_le(self.time_boot_ms);
7730 __tmp.put_u32_le(self.firmware_version);
7731 __tmp.put_f32_le(self.focal_length);
7732 __tmp.put_f32_le(self.sensor_size_h);
7733 __tmp.put_f32_le(self.sensor_size_v);
7734 __tmp.put_u32_le(self.flags.bits());
7735 __tmp.put_u16_le(self.resolution_h);
7736 __tmp.put_u16_le(self.resolution_v);
7737 __tmp.put_u16_le(self.cam_definition_version);
7738 for val in &self.vendor_name {
7739 __tmp.put_u8(*val);
7740 }
7741 for val in &self.model_name {
7742 __tmp.put_u8(*val);
7743 }
7744 __tmp.put_u8(self.lens_id);
7745 for val in &self.cam_definition_uri {
7746 __tmp.put_u8(*val);
7747 }
7748 if matches!(version, MavlinkVersion::V2) {
7749 __tmp.put_u8(self.gimbal_device_id);
7750 __tmp.put_u8(self.camera_device_id);
7751 let len = __tmp.len();
7752 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7753 } else {
7754 __tmp.len()
7755 }
7756 }
7757}
7758#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7759#[doc = ""]
7760#[doc = "ID: 260"]
7761#[derive(Debug, Clone, PartialEq)]
7762#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7763#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7764#[cfg_attr(feature = "ts", derive(TS))]
7765#[cfg_attr(feature = "ts", ts(export))]
7766pub struct CAMERA_SETTINGS_DATA {
7767 #[doc = "Timestamp (time since system boot)."]
7768 pub time_boot_ms: u32,
7769 #[doc = "Camera mode"]
7770 pub mode_id: CameraMode,
7771 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7772 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7773 pub zoomLevel: f32,
7774 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7775 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7776 pub focusLevel: f32,
7777 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7778 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7779 pub camera_device_id: u8,
7780}
7781impl CAMERA_SETTINGS_DATA {
7782 pub const ENCODED_LEN: usize = 14usize;
7783 pub const DEFAULT: Self = Self {
7784 time_boot_ms: 0_u32,
7785 mode_id: CameraMode::DEFAULT,
7786 zoomLevel: 0.0_f32,
7787 focusLevel: 0.0_f32,
7788 camera_device_id: 0_u8,
7789 };
7790 #[cfg(feature = "arbitrary")]
7791 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7792 use arbitrary::{Arbitrary, Unstructured};
7793 let mut buf = [0u8; 1024];
7794 rng.fill_bytes(&mut buf);
7795 let mut unstructured = Unstructured::new(&buf);
7796 Self::arbitrary(&mut unstructured).unwrap_or_default()
7797 }
7798}
7799impl Default for CAMERA_SETTINGS_DATA {
7800 fn default() -> Self {
7801 Self::DEFAULT.clone()
7802 }
7803}
7804impl MessageData for CAMERA_SETTINGS_DATA {
7805 type Message = MavMessage;
7806 const ID: u32 = 260u32;
7807 const NAME: &'static str = "CAMERA_SETTINGS";
7808 const EXTRA_CRC: u8 = 146u8;
7809 const ENCODED_LEN: usize = 14usize;
7810 fn deser(
7811 _version: MavlinkVersion,
7812 __input: &[u8],
7813 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7814 let avail_len = __input.len();
7815 let mut payload_buf = [0; Self::ENCODED_LEN];
7816 let mut buf = if avail_len < Self::ENCODED_LEN {
7817 payload_buf[0..avail_len].copy_from_slice(__input);
7818 Bytes::new(&payload_buf)
7819 } else {
7820 Bytes::new(__input)
7821 };
7822 let mut __struct = Self::default();
7823 __struct.time_boot_ms = buf.get_u32_le();
7824 let tmp = buf.get_u8();
7825 __struct.mode_id =
7826 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7827 enum_type: "CameraMode",
7828 value: tmp as u32,
7829 })?;
7830 __struct.zoomLevel = buf.get_f32_le();
7831 __struct.focusLevel = buf.get_f32_le();
7832 __struct.camera_device_id = buf.get_u8();
7833 Ok(__struct)
7834 }
7835 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7836 let mut __tmp = BytesMut::new(bytes);
7837 #[allow(clippy::absurd_extreme_comparisons)]
7838 #[allow(unused_comparisons)]
7839 if __tmp.remaining() < Self::ENCODED_LEN {
7840 panic!(
7841 "buffer is too small (need {} bytes, but got {})",
7842 Self::ENCODED_LEN,
7843 __tmp.remaining(),
7844 )
7845 }
7846 __tmp.put_u32_le(self.time_boot_ms);
7847 __tmp.put_u8(self.mode_id as u8);
7848 if matches!(version, MavlinkVersion::V2) {
7849 __tmp.put_f32_le(self.zoomLevel);
7850 __tmp.put_f32_le(self.focusLevel);
7851 __tmp.put_u8(self.camera_device_id);
7852 let len = __tmp.len();
7853 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7854 } else {
7855 __tmp.len()
7856 }
7857 }
7858}
7859#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7860#[doc = ""]
7861#[doc = "ID: 277"]
7862#[derive(Debug, Clone, PartialEq)]
7863#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7864#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7865#[cfg_attr(feature = "ts", derive(TS))]
7866#[cfg_attr(feature = "ts", ts(export))]
7867pub struct CAMERA_THERMAL_RANGE_DATA {
7868 #[doc = "Timestamp (time since system boot)."]
7869 pub time_boot_ms: u32,
7870 #[doc = "Temperature max."]
7871 pub max: f32,
7872 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7873 pub max_point_x: f32,
7874 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7875 pub max_point_y: f32,
7876 #[doc = "Temperature min."]
7877 pub min: f32,
7878 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7879 pub min_point_x: f32,
7880 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7881 pub min_point_y: f32,
7882 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7883 pub stream_id: u8,
7884 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7885 pub camera_device_id: u8,
7886}
7887impl CAMERA_THERMAL_RANGE_DATA {
7888 pub const ENCODED_LEN: usize = 30usize;
7889 pub const DEFAULT: Self = Self {
7890 time_boot_ms: 0_u32,
7891 max: 0.0_f32,
7892 max_point_x: 0.0_f32,
7893 max_point_y: 0.0_f32,
7894 min: 0.0_f32,
7895 min_point_x: 0.0_f32,
7896 min_point_y: 0.0_f32,
7897 stream_id: 0_u8,
7898 camera_device_id: 0_u8,
7899 };
7900 #[cfg(feature = "arbitrary")]
7901 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7902 use arbitrary::{Arbitrary, Unstructured};
7903 let mut buf = [0u8; 1024];
7904 rng.fill_bytes(&mut buf);
7905 let mut unstructured = Unstructured::new(&buf);
7906 Self::arbitrary(&mut unstructured).unwrap_or_default()
7907 }
7908}
7909impl Default for CAMERA_THERMAL_RANGE_DATA {
7910 fn default() -> Self {
7911 Self::DEFAULT.clone()
7912 }
7913}
7914impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7915 type Message = MavMessage;
7916 const ID: u32 = 277u32;
7917 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7918 const EXTRA_CRC: u8 = 62u8;
7919 const ENCODED_LEN: usize = 30usize;
7920 fn deser(
7921 _version: MavlinkVersion,
7922 __input: &[u8],
7923 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7924 let avail_len = __input.len();
7925 let mut payload_buf = [0; Self::ENCODED_LEN];
7926 let mut buf = if avail_len < Self::ENCODED_LEN {
7927 payload_buf[0..avail_len].copy_from_slice(__input);
7928 Bytes::new(&payload_buf)
7929 } else {
7930 Bytes::new(__input)
7931 };
7932 let mut __struct = Self::default();
7933 __struct.time_boot_ms = buf.get_u32_le();
7934 __struct.max = buf.get_f32_le();
7935 __struct.max_point_x = buf.get_f32_le();
7936 __struct.max_point_y = buf.get_f32_le();
7937 __struct.min = buf.get_f32_le();
7938 __struct.min_point_x = buf.get_f32_le();
7939 __struct.min_point_y = buf.get_f32_le();
7940 __struct.stream_id = buf.get_u8();
7941 __struct.camera_device_id = buf.get_u8();
7942 Ok(__struct)
7943 }
7944 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7945 let mut __tmp = BytesMut::new(bytes);
7946 #[allow(clippy::absurd_extreme_comparisons)]
7947 #[allow(unused_comparisons)]
7948 if __tmp.remaining() < Self::ENCODED_LEN {
7949 panic!(
7950 "buffer is too small (need {} bytes, but got {})",
7951 Self::ENCODED_LEN,
7952 __tmp.remaining(),
7953 )
7954 }
7955 __tmp.put_u32_le(self.time_boot_ms);
7956 __tmp.put_f32_le(self.max);
7957 __tmp.put_f32_le(self.max_point_x);
7958 __tmp.put_f32_le(self.max_point_y);
7959 __tmp.put_f32_le(self.min);
7960 __tmp.put_f32_le(self.min_point_x);
7961 __tmp.put_f32_le(self.min_point_y);
7962 __tmp.put_u8(self.stream_id);
7963 __tmp.put_u8(self.camera_device_id);
7964 if matches!(version, MavlinkVersion::V2) {
7965 let len = __tmp.len();
7966 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7967 } else {
7968 __tmp.len()
7969 }
7970 }
7971}
7972#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7973#[doc = ""]
7974#[doc = "ID: 276"]
7975#[derive(Debug, Clone, PartialEq)]
7976#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7977#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7978#[cfg_attr(feature = "ts", derive(TS))]
7979#[cfg_attr(feature = "ts", ts(export))]
7980pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7981 #[doc = "Latitude of tracked object"]
7982 pub lat: i32,
7983 #[doc = "Longitude of tracked object"]
7984 pub lon: i32,
7985 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7986 pub alt: f32,
7987 #[doc = "Horizontal accuracy. NAN if unknown"]
7988 pub h_acc: f32,
7989 #[doc = "Vertical accuracy. NAN if unknown"]
7990 pub v_acc: f32,
7991 #[doc = "North velocity of tracked object. NAN if unknown"]
7992 pub vel_n: f32,
7993 #[doc = "East velocity of tracked object. NAN if unknown"]
7994 pub vel_e: f32,
7995 #[doc = "Down velocity of tracked object. NAN if unknown"]
7996 pub vel_d: f32,
7997 #[doc = "Velocity accuracy. NAN if unknown"]
7998 pub vel_acc: f32,
7999 #[doc = "Distance between camera and tracked object. NAN if unknown"]
8000 pub dist: f32,
8001 #[doc = "Heading in radians, in NED. NAN if unknown"]
8002 pub hdg: f32,
8003 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
8004 pub hdg_acc: f32,
8005 #[doc = "Current tracking status"]
8006 pub tracking_status: CameraTrackingStatusFlags,
8007 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8008 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8009 pub camera_device_id: u8,
8010}
8011impl CAMERA_TRACKING_GEO_STATUS_DATA {
8012 pub const ENCODED_LEN: usize = 50usize;
8013 pub const DEFAULT: Self = Self {
8014 lat: 0_i32,
8015 lon: 0_i32,
8016 alt: 0.0_f32,
8017 h_acc: 0.0_f32,
8018 v_acc: 0.0_f32,
8019 vel_n: 0.0_f32,
8020 vel_e: 0.0_f32,
8021 vel_d: 0.0_f32,
8022 vel_acc: 0.0_f32,
8023 dist: 0.0_f32,
8024 hdg: 0.0_f32,
8025 hdg_acc: 0.0_f32,
8026 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8027 camera_device_id: 0_u8,
8028 };
8029 #[cfg(feature = "arbitrary")]
8030 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8031 use arbitrary::{Arbitrary, Unstructured};
8032 let mut buf = [0u8; 1024];
8033 rng.fill_bytes(&mut buf);
8034 let mut unstructured = Unstructured::new(&buf);
8035 Self::arbitrary(&mut unstructured).unwrap_or_default()
8036 }
8037}
8038impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
8039 fn default() -> Self {
8040 Self::DEFAULT.clone()
8041 }
8042}
8043impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
8044 type Message = MavMessage;
8045 const ID: u32 = 276u32;
8046 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
8047 const EXTRA_CRC: u8 = 18u8;
8048 const ENCODED_LEN: usize = 50usize;
8049 fn deser(
8050 _version: MavlinkVersion,
8051 __input: &[u8],
8052 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8053 let avail_len = __input.len();
8054 let mut payload_buf = [0; Self::ENCODED_LEN];
8055 let mut buf = if avail_len < Self::ENCODED_LEN {
8056 payload_buf[0..avail_len].copy_from_slice(__input);
8057 Bytes::new(&payload_buf)
8058 } else {
8059 Bytes::new(__input)
8060 };
8061 let mut __struct = Self::default();
8062 __struct.lat = buf.get_i32_le();
8063 __struct.lon = buf.get_i32_le();
8064 __struct.alt = buf.get_f32_le();
8065 __struct.h_acc = buf.get_f32_le();
8066 __struct.v_acc = buf.get_f32_le();
8067 __struct.vel_n = buf.get_f32_le();
8068 __struct.vel_e = buf.get_f32_le();
8069 __struct.vel_d = buf.get_f32_le();
8070 __struct.vel_acc = buf.get_f32_le();
8071 __struct.dist = buf.get_f32_le();
8072 __struct.hdg = buf.get_f32_le();
8073 __struct.hdg_acc = buf.get_f32_le();
8074 let tmp = buf.get_u8();
8075 __struct.tracking_status =
8076 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8077 enum_type: "CameraTrackingStatusFlags",
8078 value: tmp as u32,
8079 })?;
8080 __struct.camera_device_id = buf.get_u8();
8081 Ok(__struct)
8082 }
8083 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8084 let mut __tmp = BytesMut::new(bytes);
8085 #[allow(clippy::absurd_extreme_comparisons)]
8086 #[allow(unused_comparisons)]
8087 if __tmp.remaining() < Self::ENCODED_LEN {
8088 panic!(
8089 "buffer is too small (need {} bytes, but got {})",
8090 Self::ENCODED_LEN,
8091 __tmp.remaining(),
8092 )
8093 }
8094 __tmp.put_i32_le(self.lat);
8095 __tmp.put_i32_le(self.lon);
8096 __tmp.put_f32_le(self.alt);
8097 __tmp.put_f32_le(self.h_acc);
8098 __tmp.put_f32_le(self.v_acc);
8099 __tmp.put_f32_le(self.vel_n);
8100 __tmp.put_f32_le(self.vel_e);
8101 __tmp.put_f32_le(self.vel_d);
8102 __tmp.put_f32_le(self.vel_acc);
8103 __tmp.put_f32_le(self.dist);
8104 __tmp.put_f32_le(self.hdg);
8105 __tmp.put_f32_le(self.hdg_acc);
8106 __tmp.put_u8(self.tracking_status as u8);
8107 if matches!(version, MavlinkVersion::V2) {
8108 __tmp.put_u8(self.camera_device_id);
8109 let len = __tmp.len();
8110 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8111 } else {
8112 __tmp.len()
8113 }
8114 }
8115}
8116#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
8117#[doc = ""]
8118#[doc = "ID: 275"]
8119#[derive(Debug, Clone, PartialEq)]
8120#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8121#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8122#[cfg_attr(feature = "ts", derive(TS))]
8123#[cfg_attr(feature = "ts", ts(export))]
8124pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
8125 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8126 pub point_x: f32,
8127 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8128 pub point_y: f32,
8129 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
8130 pub radius: f32,
8131 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8132 pub rec_top_x: f32,
8133 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8134 pub rec_top_y: f32,
8135 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8136 pub rec_bottom_x: f32,
8137 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8138 pub rec_bottom_y: f32,
8139 #[doc = "Current tracking status"]
8140 pub tracking_status: CameraTrackingStatusFlags,
8141 #[doc = "Current tracking mode"]
8142 pub tracking_mode: CameraTrackingMode,
8143 #[doc = "Defines location of target data"]
8144 pub target_data: CameraTrackingTargetData,
8145 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8146 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8147 pub camera_device_id: u8,
8148}
8149impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
8150 pub const ENCODED_LEN: usize = 32usize;
8151 pub const DEFAULT: Self = Self {
8152 point_x: 0.0_f32,
8153 point_y: 0.0_f32,
8154 radius: 0.0_f32,
8155 rec_top_x: 0.0_f32,
8156 rec_top_y: 0.0_f32,
8157 rec_bottom_x: 0.0_f32,
8158 rec_bottom_y: 0.0_f32,
8159 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8160 tracking_mode: CameraTrackingMode::DEFAULT,
8161 target_data: CameraTrackingTargetData::DEFAULT,
8162 camera_device_id: 0_u8,
8163 };
8164 #[cfg(feature = "arbitrary")]
8165 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8166 use arbitrary::{Arbitrary, Unstructured};
8167 let mut buf = [0u8; 1024];
8168 rng.fill_bytes(&mut buf);
8169 let mut unstructured = Unstructured::new(&buf);
8170 Self::arbitrary(&mut unstructured).unwrap_or_default()
8171 }
8172}
8173impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8174 fn default() -> Self {
8175 Self::DEFAULT.clone()
8176 }
8177}
8178impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8179 type Message = MavMessage;
8180 const ID: u32 = 275u32;
8181 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
8182 const EXTRA_CRC: u8 = 126u8;
8183 const ENCODED_LEN: usize = 32usize;
8184 fn deser(
8185 _version: MavlinkVersion,
8186 __input: &[u8],
8187 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8188 let avail_len = __input.len();
8189 let mut payload_buf = [0; Self::ENCODED_LEN];
8190 let mut buf = if avail_len < Self::ENCODED_LEN {
8191 payload_buf[0..avail_len].copy_from_slice(__input);
8192 Bytes::new(&payload_buf)
8193 } else {
8194 Bytes::new(__input)
8195 };
8196 let mut __struct = Self::default();
8197 __struct.point_x = buf.get_f32_le();
8198 __struct.point_y = buf.get_f32_le();
8199 __struct.radius = buf.get_f32_le();
8200 __struct.rec_top_x = buf.get_f32_le();
8201 __struct.rec_top_y = buf.get_f32_le();
8202 __struct.rec_bottom_x = buf.get_f32_le();
8203 __struct.rec_bottom_y = buf.get_f32_le();
8204 let tmp = buf.get_u8();
8205 __struct.tracking_status =
8206 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8207 enum_type: "CameraTrackingStatusFlags",
8208 value: tmp as u32,
8209 })?;
8210 let tmp = buf.get_u8();
8211 __struct.tracking_mode =
8212 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8213 enum_type: "CameraTrackingMode",
8214 value: tmp as u32,
8215 })?;
8216 let tmp = buf.get_u8();
8217 __struct.target_data =
8218 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
8219 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8220 flag_type: "CameraTrackingTargetData",
8221 value: tmp as u32,
8222 })?;
8223 __struct.camera_device_id = buf.get_u8();
8224 Ok(__struct)
8225 }
8226 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8227 let mut __tmp = BytesMut::new(bytes);
8228 #[allow(clippy::absurd_extreme_comparisons)]
8229 #[allow(unused_comparisons)]
8230 if __tmp.remaining() < Self::ENCODED_LEN {
8231 panic!(
8232 "buffer is too small (need {} bytes, but got {})",
8233 Self::ENCODED_LEN,
8234 __tmp.remaining(),
8235 )
8236 }
8237 __tmp.put_f32_le(self.point_x);
8238 __tmp.put_f32_le(self.point_y);
8239 __tmp.put_f32_le(self.radius);
8240 __tmp.put_f32_le(self.rec_top_x);
8241 __tmp.put_f32_le(self.rec_top_y);
8242 __tmp.put_f32_le(self.rec_bottom_x);
8243 __tmp.put_f32_le(self.rec_bottom_y);
8244 __tmp.put_u8(self.tracking_status as u8);
8245 __tmp.put_u8(self.tracking_mode as u8);
8246 __tmp.put_u8(self.target_data.bits());
8247 if matches!(version, MavlinkVersion::V2) {
8248 __tmp.put_u8(self.camera_device_id);
8249 let len = __tmp.len();
8250 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8251 } else {
8252 __tmp.len()
8253 }
8254 }
8255}
8256#[doc = "Camera-IMU triggering and synchronisation message."]
8257#[doc = ""]
8258#[doc = "ID: 112"]
8259#[derive(Debug, Clone, PartialEq)]
8260#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8261#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8262#[cfg_attr(feature = "ts", derive(TS))]
8263#[cfg_attr(feature = "ts", ts(export))]
8264pub struct CAMERA_TRIGGER_DATA {
8265 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8266 pub time_usec: u64,
8267 #[doc = "Image frame sequence"]
8268 pub seq: u32,
8269}
8270impl CAMERA_TRIGGER_DATA {
8271 pub const ENCODED_LEN: usize = 12usize;
8272 pub const DEFAULT: Self = Self {
8273 time_usec: 0_u64,
8274 seq: 0_u32,
8275 };
8276 #[cfg(feature = "arbitrary")]
8277 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8278 use arbitrary::{Arbitrary, Unstructured};
8279 let mut buf = [0u8; 1024];
8280 rng.fill_bytes(&mut buf);
8281 let mut unstructured = Unstructured::new(&buf);
8282 Self::arbitrary(&mut unstructured).unwrap_or_default()
8283 }
8284}
8285impl Default for CAMERA_TRIGGER_DATA {
8286 fn default() -> Self {
8287 Self::DEFAULT.clone()
8288 }
8289}
8290impl MessageData for CAMERA_TRIGGER_DATA {
8291 type Message = MavMessage;
8292 const ID: u32 = 112u32;
8293 const NAME: &'static str = "CAMERA_TRIGGER";
8294 const EXTRA_CRC: u8 = 174u8;
8295 const ENCODED_LEN: usize = 12usize;
8296 fn deser(
8297 _version: MavlinkVersion,
8298 __input: &[u8],
8299 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8300 let avail_len = __input.len();
8301 let mut payload_buf = [0; Self::ENCODED_LEN];
8302 let mut buf = if avail_len < Self::ENCODED_LEN {
8303 payload_buf[0..avail_len].copy_from_slice(__input);
8304 Bytes::new(&payload_buf)
8305 } else {
8306 Bytes::new(__input)
8307 };
8308 let mut __struct = Self::default();
8309 __struct.time_usec = buf.get_u64_le();
8310 __struct.seq = buf.get_u32_le();
8311 Ok(__struct)
8312 }
8313 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8314 let mut __tmp = BytesMut::new(bytes);
8315 #[allow(clippy::absurd_extreme_comparisons)]
8316 #[allow(unused_comparisons)]
8317 if __tmp.remaining() < Self::ENCODED_LEN {
8318 panic!(
8319 "buffer is too small (need {} bytes, but got {})",
8320 Self::ENCODED_LEN,
8321 __tmp.remaining(),
8322 )
8323 }
8324 __tmp.put_u64_le(self.time_usec);
8325 __tmp.put_u32_le(self.seq);
8326 if matches!(version, MavlinkVersion::V2) {
8327 let len = __tmp.len();
8328 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8329 } else {
8330 __tmp.len()
8331 }
8332 }
8333}
8334#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8335#[doc = ""]
8336#[doc = "ID: 387"]
8337#[derive(Debug, Clone, PartialEq)]
8338#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8340#[cfg_attr(feature = "ts", derive(TS))]
8341#[cfg_attr(feature = "ts", ts(export))]
8342pub struct CANFD_FRAME_DATA {
8343 #[doc = "Frame ID"]
8344 pub id: u32,
8345 #[doc = "System ID."]
8346 pub target_system: u8,
8347 #[doc = "Component ID."]
8348 pub target_component: u8,
8349 #[doc = "bus number"]
8350 pub bus: u8,
8351 #[doc = "Frame length"]
8352 pub len: u8,
8353 #[doc = "Frame data"]
8354 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8355 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8356 pub data: [u8; 64],
8357}
8358impl CANFD_FRAME_DATA {
8359 pub const ENCODED_LEN: usize = 72usize;
8360 pub const DEFAULT: Self = Self {
8361 id: 0_u32,
8362 target_system: 0_u8,
8363 target_component: 0_u8,
8364 bus: 0_u8,
8365 len: 0_u8,
8366 data: [0_u8; 64usize],
8367 };
8368 #[cfg(feature = "arbitrary")]
8369 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8370 use arbitrary::{Arbitrary, Unstructured};
8371 let mut buf = [0u8; 1024];
8372 rng.fill_bytes(&mut buf);
8373 let mut unstructured = Unstructured::new(&buf);
8374 Self::arbitrary(&mut unstructured).unwrap_or_default()
8375 }
8376}
8377impl Default for CANFD_FRAME_DATA {
8378 fn default() -> Self {
8379 Self::DEFAULT.clone()
8380 }
8381}
8382impl MessageData for CANFD_FRAME_DATA {
8383 type Message = MavMessage;
8384 const ID: u32 = 387u32;
8385 const NAME: &'static str = "CANFD_FRAME";
8386 const EXTRA_CRC: u8 = 4u8;
8387 const ENCODED_LEN: usize = 72usize;
8388 fn deser(
8389 _version: MavlinkVersion,
8390 __input: &[u8],
8391 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8392 let avail_len = __input.len();
8393 let mut payload_buf = [0; Self::ENCODED_LEN];
8394 let mut buf = if avail_len < Self::ENCODED_LEN {
8395 payload_buf[0..avail_len].copy_from_slice(__input);
8396 Bytes::new(&payload_buf)
8397 } else {
8398 Bytes::new(__input)
8399 };
8400 let mut __struct = Self::default();
8401 __struct.id = buf.get_u32_le();
8402 __struct.target_system = buf.get_u8();
8403 __struct.target_component = buf.get_u8();
8404 __struct.bus = buf.get_u8();
8405 __struct.len = buf.get_u8();
8406 for v in &mut __struct.data {
8407 let val = buf.get_u8();
8408 *v = val;
8409 }
8410 Ok(__struct)
8411 }
8412 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8413 let mut __tmp = BytesMut::new(bytes);
8414 #[allow(clippy::absurd_extreme_comparisons)]
8415 #[allow(unused_comparisons)]
8416 if __tmp.remaining() < Self::ENCODED_LEN {
8417 panic!(
8418 "buffer is too small (need {} bytes, but got {})",
8419 Self::ENCODED_LEN,
8420 __tmp.remaining(),
8421 )
8422 }
8423 __tmp.put_u32_le(self.id);
8424 __tmp.put_u8(self.target_system);
8425 __tmp.put_u8(self.target_component);
8426 __tmp.put_u8(self.bus);
8427 __tmp.put_u8(self.len);
8428 for val in &self.data {
8429 __tmp.put_u8(*val);
8430 }
8431 if matches!(version, MavlinkVersion::V2) {
8432 let len = __tmp.len();
8433 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8434 } else {
8435 __tmp.len()
8436 }
8437 }
8438}
8439#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8440#[doc = ""]
8441#[doc = "ID: 388"]
8442#[derive(Debug, Clone, PartialEq)]
8443#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8444#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8445#[cfg_attr(feature = "ts", derive(TS))]
8446#[cfg_attr(feature = "ts", ts(export))]
8447pub struct CAN_FILTER_MODIFY_DATA {
8448 #[doc = "filter IDs, length num_ids"]
8449 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8450 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8451 pub ids: [u16; 16],
8452 #[doc = "System ID."]
8453 pub target_system: u8,
8454 #[doc = "Component ID."]
8455 pub target_component: u8,
8456 #[doc = "bus number"]
8457 pub bus: u8,
8458 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8459 pub operation: CanFilterOp,
8460 #[doc = "number of IDs in filter list"]
8461 pub num_ids: u8,
8462}
8463impl CAN_FILTER_MODIFY_DATA {
8464 pub const ENCODED_LEN: usize = 37usize;
8465 pub const DEFAULT: Self = Self {
8466 ids: [0_u16; 16usize],
8467 target_system: 0_u8,
8468 target_component: 0_u8,
8469 bus: 0_u8,
8470 operation: CanFilterOp::DEFAULT,
8471 num_ids: 0_u8,
8472 };
8473 #[cfg(feature = "arbitrary")]
8474 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8475 use arbitrary::{Arbitrary, Unstructured};
8476 let mut buf = [0u8; 1024];
8477 rng.fill_bytes(&mut buf);
8478 let mut unstructured = Unstructured::new(&buf);
8479 Self::arbitrary(&mut unstructured).unwrap_or_default()
8480 }
8481}
8482impl Default for CAN_FILTER_MODIFY_DATA {
8483 fn default() -> Self {
8484 Self::DEFAULT.clone()
8485 }
8486}
8487impl MessageData for CAN_FILTER_MODIFY_DATA {
8488 type Message = MavMessage;
8489 const ID: u32 = 388u32;
8490 const NAME: &'static str = "CAN_FILTER_MODIFY";
8491 const EXTRA_CRC: u8 = 8u8;
8492 const ENCODED_LEN: usize = 37usize;
8493 fn deser(
8494 _version: MavlinkVersion,
8495 __input: &[u8],
8496 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8497 let avail_len = __input.len();
8498 let mut payload_buf = [0; Self::ENCODED_LEN];
8499 let mut buf = if avail_len < Self::ENCODED_LEN {
8500 payload_buf[0..avail_len].copy_from_slice(__input);
8501 Bytes::new(&payload_buf)
8502 } else {
8503 Bytes::new(__input)
8504 };
8505 let mut __struct = Self::default();
8506 for v in &mut __struct.ids {
8507 let val = buf.get_u16_le();
8508 *v = val;
8509 }
8510 __struct.target_system = buf.get_u8();
8511 __struct.target_component = buf.get_u8();
8512 __struct.bus = buf.get_u8();
8513 let tmp = buf.get_u8();
8514 __struct.operation =
8515 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8516 enum_type: "CanFilterOp",
8517 value: tmp as u32,
8518 })?;
8519 __struct.num_ids = buf.get_u8();
8520 Ok(__struct)
8521 }
8522 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8523 let mut __tmp = BytesMut::new(bytes);
8524 #[allow(clippy::absurd_extreme_comparisons)]
8525 #[allow(unused_comparisons)]
8526 if __tmp.remaining() < Self::ENCODED_LEN {
8527 panic!(
8528 "buffer is too small (need {} bytes, but got {})",
8529 Self::ENCODED_LEN,
8530 __tmp.remaining(),
8531 )
8532 }
8533 for val in &self.ids {
8534 __tmp.put_u16_le(*val);
8535 }
8536 __tmp.put_u8(self.target_system);
8537 __tmp.put_u8(self.target_component);
8538 __tmp.put_u8(self.bus);
8539 __tmp.put_u8(self.operation as u8);
8540 __tmp.put_u8(self.num_ids);
8541 if matches!(version, MavlinkVersion::V2) {
8542 let len = __tmp.len();
8543 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8544 } else {
8545 __tmp.len()
8546 }
8547 }
8548}
8549#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8550#[doc = ""]
8551#[doc = "ID: 386"]
8552#[derive(Debug, Clone, PartialEq)]
8553#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8554#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8555#[cfg_attr(feature = "ts", derive(TS))]
8556#[cfg_attr(feature = "ts", ts(export))]
8557pub struct CAN_FRAME_DATA {
8558 #[doc = "Frame ID"]
8559 pub id: u32,
8560 #[doc = "System ID."]
8561 pub target_system: u8,
8562 #[doc = "Component ID."]
8563 pub target_component: u8,
8564 #[doc = "Bus number"]
8565 pub bus: u8,
8566 #[doc = "Frame length"]
8567 pub len: u8,
8568 #[doc = "Frame data"]
8569 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8570 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8571 pub data: [u8; 8],
8572}
8573impl CAN_FRAME_DATA {
8574 pub const ENCODED_LEN: usize = 16usize;
8575 pub const DEFAULT: Self = Self {
8576 id: 0_u32,
8577 target_system: 0_u8,
8578 target_component: 0_u8,
8579 bus: 0_u8,
8580 len: 0_u8,
8581 data: [0_u8; 8usize],
8582 };
8583 #[cfg(feature = "arbitrary")]
8584 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8585 use arbitrary::{Arbitrary, Unstructured};
8586 let mut buf = [0u8; 1024];
8587 rng.fill_bytes(&mut buf);
8588 let mut unstructured = Unstructured::new(&buf);
8589 Self::arbitrary(&mut unstructured).unwrap_or_default()
8590 }
8591}
8592impl Default for CAN_FRAME_DATA {
8593 fn default() -> Self {
8594 Self::DEFAULT.clone()
8595 }
8596}
8597impl MessageData for CAN_FRAME_DATA {
8598 type Message = MavMessage;
8599 const ID: u32 = 386u32;
8600 const NAME: &'static str = "CAN_FRAME";
8601 const EXTRA_CRC: u8 = 132u8;
8602 const ENCODED_LEN: usize = 16usize;
8603 fn deser(
8604 _version: MavlinkVersion,
8605 __input: &[u8],
8606 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8607 let avail_len = __input.len();
8608 let mut payload_buf = [0; Self::ENCODED_LEN];
8609 let mut buf = if avail_len < Self::ENCODED_LEN {
8610 payload_buf[0..avail_len].copy_from_slice(__input);
8611 Bytes::new(&payload_buf)
8612 } else {
8613 Bytes::new(__input)
8614 };
8615 let mut __struct = Self::default();
8616 __struct.id = buf.get_u32_le();
8617 __struct.target_system = buf.get_u8();
8618 __struct.target_component = buf.get_u8();
8619 __struct.bus = buf.get_u8();
8620 __struct.len = buf.get_u8();
8621 for v in &mut __struct.data {
8622 let val = buf.get_u8();
8623 *v = val;
8624 }
8625 Ok(__struct)
8626 }
8627 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8628 let mut __tmp = BytesMut::new(bytes);
8629 #[allow(clippy::absurd_extreme_comparisons)]
8630 #[allow(unused_comparisons)]
8631 if __tmp.remaining() < Self::ENCODED_LEN {
8632 panic!(
8633 "buffer is too small (need {} bytes, but got {})",
8634 Self::ENCODED_LEN,
8635 __tmp.remaining(),
8636 )
8637 }
8638 __tmp.put_u32_le(self.id);
8639 __tmp.put_u8(self.target_system);
8640 __tmp.put_u8(self.target_component);
8641 __tmp.put_u8(self.bus);
8642 __tmp.put_u8(self.len);
8643 for val in &self.data {
8644 __tmp.put_u8(*val);
8645 }
8646 if matches!(version, MavlinkVersion::V2) {
8647 let len = __tmp.len();
8648 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8649 } else {
8650 __tmp.len()
8651 }
8652 }
8653}
8654#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8655#[doc = ""]
8656#[doc = "ID: 336"]
8657#[derive(Debug, Clone, PartialEq)]
8658#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8660#[cfg_attr(feature = "ts", derive(TS))]
8661#[cfg_attr(feature = "ts", ts(export))]
8662pub struct CELLULAR_CONFIG_DATA {
8663 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8664 pub enable_lte: u8,
8665 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8666 pub enable_pin: u8,
8667 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8668 #[cfg_attr(
8669 feature = "serde",
8670 serde(
8671 serialize_with = "crate::nulstr::serialize::<_, 16>",
8672 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
8673 )
8674 )]
8675 #[cfg_attr(feature = "ts", ts(type = "string"))]
8676 pub pin: [u8; 16],
8677 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8678 #[cfg_attr(
8679 feature = "serde",
8680 serde(
8681 serialize_with = "crate::nulstr::serialize::<_, 16>",
8682 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
8683 )
8684 )]
8685 #[cfg_attr(feature = "ts", ts(type = "string"))]
8686 pub new_pin: [u8; 16],
8687 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8688 #[cfg_attr(
8689 feature = "serde",
8690 serde(
8691 serialize_with = "crate::nulstr::serialize::<_, 32>",
8692 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
8693 )
8694 )]
8695 #[cfg_attr(feature = "ts", ts(type = "string"))]
8696 pub apn: [u8; 32],
8697 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8698 #[cfg_attr(
8699 feature = "serde",
8700 serde(
8701 serialize_with = "crate::nulstr::serialize::<_, 16>",
8702 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
8703 )
8704 )]
8705 #[cfg_attr(feature = "ts", ts(type = "string"))]
8706 pub puk: [u8; 16],
8707 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8708 pub roaming: u8,
8709 #[doc = "Message acceptance response (sent back to GS)."]
8710 pub response: CellularConfigResponse,
8711}
8712impl CELLULAR_CONFIG_DATA {
8713 pub const ENCODED_LEN: usize = 84usize;
8714 pub const DEFAULT: Self = Self {
8715 enable_lte: 0_u8,
8716 enable_pin: 0_u8,
8717 pin: [0_u8; 16usize],
8718 new_pin: [0_u8; 16usize],
8719 apn: [0_u8; 32usize],
8720 puk: [0_u8; 16usize],
8721 roaming: 0_u8,
8722 response: CellularConfigResponse::DEFAULT,
8723 };
8724 #[cfg(feature = "arbitrary")]
8725 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8726 use arbitrary::{Arbitrary, Unstructured};
8727 let mut buf = [0u8; 1024];
8728 rng.fill_bytes(&mut buf);
8729 let mut unstructured = Unstructured::new(&buf);
8730 Self::arbitrary(&mut unstructured).unwrap_or_default()
8731 }
8732}
8733impl Default for CELLULAR_CONFIG_DATA {
8734 fn default() -> Self {
8735 Self::DEFAULT.clone()
8736 }
8737}
8738impl MessageData for CELLULAR_CONFIG_DATA {
8739 type Message = MavMessage;
8740 const ID: u32 = 336u32;
8741 const NAME: &'static str = "CELLULAR_CONFIG";
8742 const EXTRA_CRC: u8 = 245u8;
8743 const ENCODED_LEN: usize = 84usize;
8744 fn deser(
8745 _version: MavlinkVersion,
8746 __input: &[u8],
8747 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8748 let avail_len = __input.len();
8749 let mut payload_buf = [0; Self::ENCODED_LEN];
8750 let mut buf = if avail_len < Self::ENCODED_LEN {
8751 payload_buf[0..avail_len].copy_from_slice(__input);
8752 Bytes::new(&payload_buf)
8753 } else {
8754 Bytes::new(__input)
8755 };
8756 let mut __struct = Self::default();
8757 __struct.enable_lte = buf.get_u8();
8758 __struct.enable_pin = buf.get_u8();
8759 for v in &mut __struct.pin {
8760 let val = buf.get_u8();
8761 *v = val;
8762 }
8763 for v in &mut __struct.new_pin {
8764 let val = buf.get_u8();
8765 *v = val;
8766 }
8767 for v in &mut __struct.apn {
8768 let val = buf.get_u8();
8769 *v = val;
8770 }
8771 for v in &mut __struct.puk {
8772 let val = buf.get_u8();
8773 *v = val;
8774 }
8775 __struct.roaming = buf.get_u8();
8776 let tmp = buf.get_u8();
8777 __struct.response =
8778 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8779 enum_type: "CellularConfigResponse",
8780 value: tmp as u32,
8781 })?;
8782 Ok(__struct)
8783 }
8784 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8785 let mut __tmp = BytesMut::new(bytes);
8786 #[allow(clippy::absurd_extreme_comparisons)]
8787 #[allow(unused_comparisons)]
8788 if __tmp.remaining() < Self::ENCODED_LEN {
8789 panic!(
8790 "buffer is too small (need {} bytes, but got {})",
8791 Self::ENCODED_LEN,
8792 __tmp.remaining(),
8793 )
8794 }
8795 __tmp.put_u8(self.enable_lte);
8796 __tmp.put_u8(self.enable_pin);
8797 for val in &self.pin {
8798 __tmp.put_u8(*val);
8799 }
8800 for val in &self.new_pin {
8801 __tmp.put_u8(*val);
8802 }
8803 for val in &self.apn {
8804 __tmp.put_u8(*val);
8805 }
8806 for val in &self.puk {
8807 __tmp.put_u8(*val);
8808 }
8809 __tmp.put_u8(self.roaming);
8810 __tmp.put_u8(self.response as u8);
8811 if matches!(version, MavlinkVersion::V2) {
8812 let len = __tmp.len();
8813 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8814 } else {
8815 __tmp.len()
8816 }
8817 }
8818}
8819#[doc = "Report current used cellular network status."]
8820#[doc = ""]
8821#[doc = "ID: 334"]
8822#[derive(Debug, Clone, PartialEq)]
8823#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8824#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8825#[cfg_attr(feature = "ts", derive(TS))]
8826#[cfg_attr(feature = "ts", ts(export))]
8827pub struct CELLULAR_STATUS_DATA {
8828 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8829 pub mcc: u16,
8830 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8831 pub mnc: u16,
8832 #[doc = "Location area code. If unknown, set to 0"]
8833 pub lac: u16,
8834 #[doc = "Cellular modem status"]
8835 pub status: CellularStatusFlag,
8836 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8837 pub failure_reason: CellularNetworkFailedReason,
8838 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8839 pub mavtype: CellularNetworkRadioType,
8840 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8841 pub quality: u8,
8842}
8843impl CELLULAR_STATUS_DATA {
8844 pub const ENCODED_LEN: usize = 10usize;
8845 pub const DEFAULT: Self = Self {
8846 mcc: 0_u16,
8847 mnc: 0_u16,
8848 lac: 0_u16,
8849 status: CellularStatusFlag::DEFAULT,
8850 failure_reason: CellularNetworkFailedReason::DEFAULT,
8851 mavtype: CellularNetworkRadioType::DEFAULT,
8852 quality: 0_u8,
8853 };
8854 #[cfg(feature = "arbitrary")]
8855 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8856 use arbitrary::{Arbitrary, Unstructured};
8857 let mut buf = [0u8; 1024];
8858 rng.fill_bytes(&mut buf);
8859 let mut unstructured = Unstructured::new(&buf);
8860 Self::arbitrary(&mut unstructured).unwrap_or_default()
8861 }
8862}
8863impl Default for CELLULAR_STATUS_DATA {
8864 fn default() -> Self {
8865 Self::DEFAULT.clone()
8866 }
8867}
8868impl MessageData for CELLULAR_STATUS_DATA {
8869 type Message = MavMessage;
8870 const ID: u32 = 334u32;
8871 const NAME: &'static str = "CELLULAR_STATUS";
8872 const EXTRA_CRC: u8 = 72u8;
8873 const ENCODED_LEN: usize = 10usize;
8874 fn deser(
8875 _version: MavlinkVersion,
8876 __input: &[u8],
8877 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8878 let avail_len = __input.len();
8879 let mut payload_buf = [0; Self::ENCODED_LEN];
8880 let mut buf = if avail_len < Self::ENCODED_LEN {
8881 payload_buf[0..avail_len].copy_from_slice(__input);
8882 Bytes::new(&payload_buf)
8883 } else {
8884 Bytes::new(__input)
8885 };
8886 let mut __struct = Self::default();
8887 __struct.mcc = buf.get_u16_le();
8888 __struct.mnc = buf.get_u16_le();
8889 __struct.lac = buf.get_u16_le();
8890 let tmp = buf.get_u8();
8891 __struct.status =
8892 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8893 enum_type: "CellularStatusFlag",
8894 value: tmp as u32,
8895 })?;
8896 let tmp = buf.get_u8();
8897 __struct.failure_reason =
8898 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8899 enum_type: "CellularNetworkFailedReason",
8900 value: tmp as u32,
8901 })?;
8902 let tmp = buf.get_u8();
8903 __struct.mavtype =
8904 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8905 enum_type: "CellularNetworkRadioType",
8906 value: tmp as u32,
8907 })?;
8908 __struct.quality = buf.get_u8();
8909 Ok(__struct)
8910 }
8911 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8912 let mut __tmp = BytesMut::new(bytes);
8913 #[allow(clippy::absurd_extreme_comparisons)]
8914 #[allow(unused_comparisons)]
8915 if __tmp.remaining() < Self::ENCODED_LEN {
8916 panic!(
8917 "buffer is too small (need {} bytes, but got {})",
8918 Self::ENCODED_LEN,
8919 __tmp.remaining(),
8920 )
8921 }
8922 __tmp.put_u16_le(self.mcc);
8923 __tmp.put_u16_le(self.mnc);
8924 __tmp.put_u16_le(self.lac);
8925 __tmp.put_u8(self.status as u8);
8926 __tmp.put_u8(self.failure_reason as u8);
8927 __tmp.put_u8(self.mavtype as u8);
8928 __tmp.put_u8(self.quality);
8929 if matches!(version, MavlinkVersion::V2) {
8930 let len = __tmp.len();
8931 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8932 } else {
8933 __tmp.len()
8934 }
8935 }
8936}
8937#[doc = "Request to control this MAV."]
8938#[doc = ""]
8939#[doc = "ID: 5"]
8940#[derive(Debug, Clone, PartialEq)]
8941#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8942#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8943#[cfg_attr(feature = "ts", derive(TS))]
8944#[cfg_attr(feature = "ts", ts(export))]
8945pub struct CHANGE_OPERATOR_CONTROL_DATA {
8946 #[doc = "System the GCS requests control for"]
8947 pub target_system: u8,
8948 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8949 pub control_request: u8,
8950 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8951 pub version: u8,
8952 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8953 #[cfg_attr(
8954 feature = "serde",
8955 serde(
8956 serialize_with = "crate::nulstr::serialize::<_, 25>",
8957 deserialize_with = "crate::nulstr::deserialize::<_, 25>"
8958 )
8959 )]
8960 #[cfg_attr(feature = "ts", ts(type = "string"))]
8961 pub passkey: [u8; 25],
8962}
8963impl CHANGE_OPERATOR_CONTROL_DATA {
8964 pub const ENCODED_LEN: usize = 28usize;
8965 pub const DEFAULT: Self = Self {
8966 target_system: 0_u8,
8967 control_request: 0_u8,
8968 version: 0_u8,
8969 passkey: [0_u8; 25usize],
8970 };
8971 #[cfg(feature = "arbitrary")]
8972 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8973 use arbitrary::{Arbitrary, Unstructured};
8974 let mut buf = [0u8; 1024];
8975 rng.fill_bytes(&mut buf);
8976 let mut unstructured = Unstructured::new(&buf);
8977 Self::arbitrary(&mut unstructured).unwrap_or_default()
8978 }
8979}
8980impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8981 fn default() -> Self {
8982 Self::DEFAULT.clone()
8983 }
8984}
8985impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8986 type Message = MavMessage;
8987 const ID: u32 = 5u32;
8988 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8989 const EXTRA_CRC: u8 = 217u8;
8990 const ENCODED_LEN: usize = 28usize;
8991 fn deser(
8992 _version: MavlinkVersion,
8993 __input: &[u8],
8994 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8995 let avail_len = __input.len();
8996 let mut payload_buf = [0; Self::ENCODED_LEN];
8997 let mut buf = if avail_len < Self::ENCODED_LEN {
8998 payload_buf[0..avail_len].copy_from_slice(__input);
8999 Bytes::new(&payload_buf)
9000 } else {
9001 Bytes::new(__input)
9002 };
9003 let mut __struct = Self::default();
9004 __struct.target_system = buf.get_u8();
9005 __struct.control_request = buf.get_u8();
9006 __struct.version = buf.get_u8();
9007 for v in &mut __struct.passkey {
9008 let val = buf.get_u8();
9009 *v = val;
9010 }
9011 Ok(__struct)
9012 }
9013 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9014 let mut __tmp = BytesMut::new(bytes);
9015 #[allow(clippy::absurd_extreme_comparisons)]
9016 #[allow(unused_comparisons)]
9017 if __tmp.remaining() < Self::ENCODED_LEN {
9018 panic!(
9019 "buffer is too small (need {} bytes, but got {})",
9020 Self::ENCODED_LEN,
9021 __tmp.remaining(),
9022 )
9023 }
9024 __tmp.put_u8(self.target_system);
9025 __tmp.put_u8(self.control_request);
9026 __tmp.put_u8(self.version);
9027 for val in &self.passkey {
9028 __tmp.put_u8(*val);
9029 }
9030 if matches!(version, MavlinkVersion::V2) {
9031 let len = __tmp.len();
9032 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9033 } else {
9034 __tmp.len()
9035 }
9036 }
9037}
9038#[doc = "Accept / deny control of this MAV."]
9039#[doc = ""]
9040#[doc = "ID: 6"]
9041#[derive(Debug, Clone, PartialEq)]
9042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9043#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9044#[cfg_attr(feature = "ts", derive(TS))]
9045#[cfg_attr(feature = "ts", ts(export))]
9046pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
9047 #[doc = "ID of the GCS this message"]
9048 pub gcs_system_id: u8,
9049 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
9050 pub control_request: u8,
9051 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
9052 pub ack: u8,
9053}
9054impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
9055 pub const ENCODED_LEN: usize = 3usize;
9056 pub const DEFAULT: Self = Self {
9057 gcs_system_id: 0_u8,
9058 control_request: 0_u8,
9059 ack: 0_u8,
9060 };
9061 #[cfg(feature = "arbitrary")]
9062 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9063 use arbitrary::{Arbitrary, Unstructured};
9064 let mut buf = [0u8; 1024];
9065 rng.fill_bytes(&mut buf);
9066 let mut unstructured = Unstructured::new(&buf);
9067 Self::arbitrary(&mut unstructured).unwrap_or_default()
9068 }
9069}
9070impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
9071 fn default() -> Self {
9072 Self::DEFAULT.clone()
9073 }
9074}
9075impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
9076 type Message = MavMessage;
9077 const ID: u32 = 6u32;
9078 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
9079 const EXTRA_CRC: u8 = 104u8;
9080 const ENCODED_LEN: usize = 3usize;
9081 fn deser(
9082 _version: MavlinkVersion,
9083 __input: &[u8],
9084 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9085 let avail_len = __input.len();
9086 let mut payload_buf = [0; Self::ENCODED_LEN];
9087 let mut buf = if avail_len < Self::ENCODED_LEN {
9088 payload_buf[0..avail_len].copy_from_slice(__input);
9089 Bytes::new(&payload_buf)
9090 } else {
9091 Bytes::new(__input)
9092 };
9093 let mut __struct = Self::default();
9094 __struct.gcs_system_id = buf.get_u8();
9095 __struct.control_request = buf.get_u8();
9096 __struct.ack = buf.get_u8();
9097 Ok(__struct)
9098 }
9099 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9100 let mut __tmp = BytesMut::new(bytes);
9101 #[allow(clippy::absurd_extreme_comparisons)]
9102 #[allow(unused_comparisons)]
9103 if __tmp.remaining() < Self::ENCODED_LEN {
9104 panic!(
9105 "buffer is too small (need {} bytes, but got {})",
9106 Self::ENCODED_LEN,
9107 __tmp.remaining(),
9108 )
9109 }
9110 __tmp.put_u8(self.gcs_system_id);
9111 __tmp.put_u8(self.control_request);
9112 __tmp.put_u8(self.ack);
9113 if matches!(version, MavlinkVersion::V2) {
9114 let len = __tmp.len();
9115 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9116 } else {
9117 __tmp.len()
9118 }
9119 }
9120}
9121#[doc = "Information about a potential collision."]
9122#[doc = ""]
9123#[doc = "ID: 247"]
9124#[derive(Debug, Clone, PartialEq)]
9125#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9126#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9127#[cfg_attr(feature = "ts", derive(TS))]
9128#[cfg_attr(feature = "ts", ts(export))]
9129pub struct COLLISION_DATA {
9130 #[doc = "Unique identifier, domain based on src field"]
9131 pub id: u32,
9132 #[doc = "Estimated time until collision occurs"]
9133 pub time_to_minimum_delta: f32,
9134 #[doc = "Closest vertical distance between vehicle and object"]
9135 pub altitude_minimum_delta: f32,
9136 #[doc = "Closest horizontal distance between vehicle and object"]
9137 pub horizontal_minimum_delta: f32,
9138 #[doc = "Collision data source"]
9139 pub src: MavCollisionSrc,
9140 #[doc = "Action that is being taken to avoid this collision"]
9141 pub action: MavCollisionAction,
9142 #[doc = "How concerned the aircraft is about this collision"]
9143 pub threat_level: MavCollisionThreatLevel,
9144}
9145impl COLLISION_DATA {
9146 pub const ENCODED_LEN: usize = 19usize;
9147 pub const DEFAULT: Self = Self {
9148 id: 0_u32,
9149 time_to_minimum_delta: 0.0_f32,
9150 altitude_minimum_delta: 0.0_f32,
9151 horizontal_minimum_delta: 0.0_f32,
9152 src: MavCollisionSrc::DEFAULT,
9153 action: MavCollisionAction::DEFAULT,
9154 threat_level: MavCollisionThreatLevel::DEFAULT,
9155 };
9156 #[cfg(feature = "arbitrary")]
9157 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9158 use arbitrary::{Arbitrary, Unstructured};
9159 let mut buf = [0u8; 1024];
9160 rng.fill_bytes(&mut buf);
9161 let mut unstructured = Unstructured::new(&buf);
9162 Self::arbitrary(&mut unstructured).unwrap_or_default()
9163 }
9164}
9165impl Default for COLLISION_DATA {
9166 fn default() -> Self {
9167 Self::DEFAULT.clone()
9168 }
9169}
9170impl MessageData for COLLISION_DATA {
9171 type Message = MavMessage;
9172 const ID: u32 = 247u32;
9173 const NAME: &'static str = "COLLISION";
9174 const EXTRA_CRC: u8 = 81u8;
9175 const ENCODED_LEN: usize = 19usize;
9176 fn deser(
9177 _version: MavlinkVersion,
9178 __input: &[u8],
9179 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9180 let avail_len = __input.len();
9181 let mut payload_buf = [0; Self::ENCODED_LEN];
9182 let mut buf = if avail_len < Self::ENCODED_LEN {
9183 payload_buf[0..avail_len].copy_from_slice(__input);
9184 Bytes::new(&payload_buf)
9185 } else {
9186 Bytes::new(__input)
9187 };
9188 let mut __struct = Self::default();
9189 __struct.id = buf.get_u32_le();
9190 __struct.time_to_minimum_delta = buf.get_f32_le();
9191 __struct.altitude_minimum_delta = buf.get_f32_le();
9192 __struct.horizontal_minimum_delta = buf.get_f32_le();
9193 let tmp = buf.get_u8();
9194 __struct.src =
9195 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9196 enum_type: "MavCollisionSrc",
9197 value: tmp as u32,
9198 })?;
9199 let tmp = buf.get_u8();
9200 __struct.action =
9201 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9202 enum_type: "MavCollisionAction",
9203 value: tmp as u32,
9204 })?;
9205 let tmp = buf.get_u8();
9206 __struct.threat_level =
9207 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9208 enum_type: "MavCollisionThreatLevel",
9209 value: tmp as u32,
9210 })?;
9211 Ok(__struct)
9212 }
9213 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9214 let mut __tmp = BytesMut::new(bytes);
9215 #[allow(clippy::absurd_extreme_comparisons)]
9216 #[allow(unused_comparisons)]
9217 if __tmp.remaining() < Self::ENCODED_LEN {
9218 panic!(
9219 "buffer is too small (need {} bytes, but got {})",
9220 Self::ENCODED_LEN,
9221 __tmp.remaining(),
9222 )
9223 }
9224 __tmp.put_u32_le(self.id);
9225 __tmp.put_f32_le(self.time_to_minimum_delta);
9226 __tmp.put_f32_le(self.altitude_minimum_delta);
9227 __tmp.put_f32_le(self.horizontal_minimum_delta);
9228 __tmp.put_u8(self.src as u8);
9229 __tmp.put_u8(self.action as u8);
9230 __tmp.put_u8(self.threat_level as u8);
9231 if matches!(version, MavlinkVersion::V2) {
9232 let len = __tmp.len();
9233 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9234 } else {
9235 __tmp.len()
9236 }
9237 }
9238}
9239#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9240#[doc = ""]
9241#[doc = "ID: 77"]
9242#[derive(Debug, Clone, PartialEq)]
9243#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9244#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9245#[cfg_attr(feature = "ts", derive(TS))]
9246#[cfg_attr(feature = "ts", ts(export))]
9247pub struct COMMAND_ACK_DATA {
9248 #[doc = "Command ID (of acknowledged command)."]
9249 pub command: MavCmd,
9250 #[doc = "Result of command."]
9251 pub result: MavResult,
9252 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
9253 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9254 pub progress: u8,
9255 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
9256 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9257 pub result_param2: i32,
9258 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9259 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9260 pub target_system: u8,
9261 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9262 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9263 pub target_component: u8,
9264}
9265impl COMMAND_ACK_DATA {
9266 pub const ENCODED_LEN: usize = 10usize;
9267 pub const DEFAULT: Self = Self {
9268 command: MavCmd::DEFAULT,
9269 result: MavResult::DEFAULT,
9270 progress: 0_u8,
9271 result_param2: 0_i32,
9272 target_system: 0_u8,
9273 target_component: 0_u8,
9274 };
9275 #[cfg(feature = "arbitrary")]
9276 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9277 use arbitrary::{Arbitrary, Unstructured};
9278 let mut buf = [0u8; 1024];
9279 rng.fill_bytes(&mut buf);
9280 let mut unstructured = Unstructured::new(&buf);
9281 Self::arbitrary(&mut unstructured).unwrap_or_default()
9282 }
9283}
9284impl Default for COMMAND_ACK_DATA {
9285 fn default() -> Self {
9286 Self::DEFAULT.clone()
9287 }
9288}
9289impl MessageData for COMMAND_ACK_DATA {
9290 type Message = MavMessage;
9291 const ID: u32 = 77u32;
9292 const NAME: &'static str = "COMMAND_ACK";
9293 const EXTRA_CRC: u8 = 143u8;
9294 const ENCODED_LEN: usize = 10usize;
9295 fn deser(
9296 _version: MavlinkVersion,
9297 __input: &[u8],
9298 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9299 let avail_len = __input.len();
9300 let mut payload_buf = [0; Self::ENCODED_LEN];
9301 let mut buf = if avail_len < Self::ENCODED_LEN {
9302 payload_buf[0..avail_len].copy_from_slice(__input);
9303 Bytes::new(&payload_buf)
9304 } else {
9305 Bytes::new(__input)
9306 };
9307 let mut __struct = Self::default();
9308 let tmp = buf.get_u16_le();
9309 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9310 ::mavlink_core::error::ParserError::InvalidEnum {
9311 enum_type: "MavCmd",
9312 value: tmp as u32,
9313 },
9314 )?;
9315 let tmp = buf.get_u8();
9316 __struct.result =
9317 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9318 enum_type: "MavResult",
9319 value: tmp as u32,
9320 })?;
9321 __struct.progress = buf.get_u8();
9322 __struct.result_param2 = buf.get_i32_le();
9323 __struct.target_system = buf.get_u8();
9324 __struct.target_component = buf.get_u8();
9325 Ok(__struct)
9326 }
9327 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9328 let mut __tmp = BytesMut::new(bytes);
9329 #[allow(clippy::absurd_extreme_comparisons)]
9330 #[allow(unused_comparisons)]
9331 if __tmp.remaining() < Self::ENCODED_LEN {
9332 panic!(
9333 "buffer is too small (need {} bytes, but got {})",
9334 Self::ENCODED_LEN,
9335 __tmp.remaining(),
9336 )
9337 }
9338 __tmp.put_u16_le(self.command as u16);
9339 __tmp.put_u8(self.result as u8);
9340 if matches!(version, MavlinkVersion::V2) {
9341 __tmp.put_u8(self.progress);
9342 __tmp.put_i32_le(self.result_param2);
9343 __tmp.put_u8(self.target_system);
9344 __tmp.put_u8(self.target_component);
9345 let len = __tmp.len();
9346 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9347 } else {
9348 __tmp.len()
9349 }
9350 }
9351}
9352#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9353#[doc = ""]
9354#[doc = "ID: 80"]
9355#[derive(Debug, Clone, PartialEq)]
9356#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9357#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9358#[cfg_attr(feature = "ts", derive(TS))]
9359#[cfg_attr(feature = "ts", ts(export))]
9360pub struct COMMAND_CANCEL_DATA {
9361 #[doc = "Command ID (of command to cancel)."]
9362 pub command: MavCmd,
9363 #[doc = "System executing long running command. Should not be broadcast (0)."]
9364 pub target_system: u8,
9365 #[doc = "Component executing long running command."]
9366 pub target_component: u8,
9367}
9368impl COMMAND_CANCEL_DATA {
9369 pub const ENCODED_LEN: usize = 4usize;
9370 pub const DEFAULT: Self = Self {
9371 command: MavCmd::DEFAULT,
9372 target_system: 0_u8,
9373 target_component: 0_u8,
9374 };
9375 #[cfg(feature = "arbitrary")]
9376 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9377 use arbitrary::{Arbitrary, Unstructured};
9378 let mut buf = [0u8; 1024];
9379 rng.fill_bytes(&mut buf);
9380 let mut unstructured = Unstructured::new(&buf);
9381 Self::arbitrary(&mut unstructured).unwrap_or_default()
9382 }
9383}
9384impl Default for COMMAND_CANCEL_DATA {
9385 fn default() -> Self {
9386 Self::DEFAULT.clone()
9387 }
9388}
9389impl MessageData for COMMAND_CANCEL_DATA {
9390 type Message = MavMessage;
9391 const ID: u32 = 80u32;
9392 const NAME: &'static str = "COMMAND_CANCEL";
9393 const EXTRA_CRC: u8 = 14u8;
9394 const ENCODED_LEN: usize = 4usize;
9395 fn deser(
9396 _version: MavlinkVersion,
9397 __input: &[u8],
9398 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9399 let avail_len = __input.len();
9400 let mut payload_buf = [0; Self::ENCODED_LEN];
9401 let mut buf = if avail_len < Self::ENCODED_LEN {
9402 payload_buf[0..avail_len].copy_from_slice(__input);
9403 Bytes::new(&payload_buf)
9404 } else {
9405 Bytes::new(__input)
9406 };
9407 let mut __struct = Self::default();
9408 let tmp = buf.get_u16_le();
9409 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9410 ::mavlink_core::error::ParserError::InvalidEnum {
9411 enum_type: "MavCmd",
9412 value: tmp as u32,
9413 },
9414 )?;
9415 __struct.target_system = buf.get_u8();
9416 __struct.target_component = buf.get_u8();
9417 Ok(__struct)
9418 }
9419 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9420 let mut __tmp = BytesMut::new(bytes);
9421 #[allow(clippy::absurd_extreme_comparisons)]
9422 #[allow(unused_comparisons)]
9423 if __tmp.remaining() < Self::ENCODED_LEN {
9424 panic!(
9425 "buffer is too small (need {} bytes, but got {})",
9426 Self::ENCODED_LEN,
9427 __tmp.remaining(),
9428 )
9429 }
9430 __tmp.put_u16_le(self.command as u16);
9431 __tmp.put_u8(self.target_system);
9432 __tmp.put_u8(self.target_component);
9433 if matches!(version, MavlinkVersion::V2) {
9434 let len = __tmp.len();
9435 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9436 } else {
9437 __tmp.len()
9438 }
9439 }
9440}
9441#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9442#[doc = ""]
9443#[doc = "ID: 75"]
9444#[derive(Debug, Clone, PartialEq)]
9445#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9446#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9447#[cfg_attr(feature = "ts", derive(TS))]
9448#[cfg_attr(feature = "ts", ts(export))]
9449pub struct COMMAND_INT_DATA {
9450 #[doc = "PARAM1, see MAV_CMD enum"]
9451 pub param1: f32,
9452 #[doc = "PARAM2, see MAV_CMD enum"]
9453 pub param2: f32,
9454 #[doc = "PARAM3, see MAV_CMD enum"]
9455 pub param3: f32,
9456 #[doc = "PARAM4, see MAV_CMD enum"]
9457 pub param4: f32,
9458 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9459 pub x: i32,
9460 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9461 pub y: i32,
9462 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9463 pub z: f32,
9464 #[doc = "The scheduled action for the mission item."]
9465 pub command: MavCmd,
9466 #[doc = "System ID"]
9467 pub target_system: u8,
9468 #[doc = "Component ID"]
9469 pub target_component: u8,
9470 #[doc = "The coordinate system of the COMMAND."]
9471 pub frame: MavFrame,
9472 #[doc = "Not used."]
9473 pub current: u8,
9474 #[doc = "Not used (set 0)."]
9475 pub autocontinue: u8,
9476}
9477impl COMMAND_INT_DATA {
9478 pub const ENCODED_LEN: usize = 35usize;
9479 pub const DEFAULT: Self = Self {
9480 param1: 0.0_f32,
9481 param2: 0.0_f32,
9482 param3: 0.0_f32,
9483 param4: 0.0_f32,
9484 x: 0_i32,
9485 y: 0_i32,
9486 z: 0.0_f32,
9487 command: MavCmd::DEFAULT,
9488 target_system: 0_u8,
9489 target_component: 0_u8,
9490 frame: MavFrame::DEFAULT,
9491 current: 0_u8,
9492 autocontinue: 0_u8,
9493 };
9494 #[cfg(feature = "arbitrary")]
9495 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9496 use arbitrary::{Arbitrary, Unstructured};
9497 let mut buf = [0u8; 1024];
9498 rng.fill_bytes(&mut buf);
9499 let mut unstructured = Unstructured::new(&buf);
9500 Self::arbitrary(&mut unstructured).unwrap_or_default()
9501 }
9502}
9503impl Default for COMMAND_INT_DATA {
9504 fn default() -> Self {
9505 Self::DEFAULT.clone()
9506 }
9507}
9508impl MessageData for COMMAND_INT_DATA {
9509 type Message = MavMessage;
9510 const ID: u32 = 75u32;
9511 const NAME: &'static str = "COMMAND_INT";
9512 const EXTRA_CRC: u8 = 158u8;
9513 const ENCODED_LEN: usize = 35usize;
9514 fn deser(
9515 _version: MavlinkVersion,
9516 __input: &[u8],
9517 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9518 let avail_len = __input.len();
9519 let mut payload_buf = [0; Self::ENCODED_LEN];
9520 let mut buf = if avail_len < Self::ENCODED_LEN {
9521 payload_buf[0..avail_len].copy_from_slice(__input);
9522 Bytes::new(&payload_buf)
9523 } else {
9524 Bytes::new(__input)
9525 };
9526 let mut __struct = Self::default();
9527 __struct.param1 = buf.get_f32_le();
9528 __struct.param2 = buf.get_f32_le();
9529 __struct.param3 = buf.get_f32_le();
9530 __struct.param4 = buf.get_f32_le();
9531 __struct.x = buf.get_i32_le();
9532 __struct.y = buf.get_i32_le();
9533 __struct.z = buf.get_f32_le();
9534 let tmp = buf.get_u16_le();
9535 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9536 ::mavlink_core::error::ParserError::InvalidEnum {
9537 enum_type: "MavCmd",
9538 value: tmp as u32,
9539 },
9540 )?;
9541 __struct.target_system = buf.get_u8();
9542 __struct.target_component = buf.get_u8();
9543 let tmp = buf.get_u8();
9544 __struct.frame =
9545 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9546 enum_type: "MavFrame",
9547 value: tmp as u32,
9548 })?;
9549 __struct.current = buf.get_u8();
9550 __struct.autocontinue = buf.get_u8();
9551 Ok(__struct)
9552 }
9553 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9554 let mut __tmp = BytesMut::new(bytes);
9555 #[allow(clippy::absurd_extreme_comparisons)]
9556 #[allow(unused_comparisons)]
9557 if __tmp.remaining() < Self::ENCODED_LEN {
9558 panic!(
9559 "buffer is too small (need {} bytes, but got {})",
9560 Self::ENCODED_LEN,
9561 __tmp.remaining(),
9562 )
9563 }
9564 __tmp.put_f32_le(self.param1);
9565 __tmp.put_f32_le(self.param2);
9566 __tmp.put_f32_le(self.param3);
9567 __tmp.put_f32_le(self.param4);
9568 __tmp.put_i32_le(self.x);
9569 __tmp.put_i32_le(self.y);
9570 __tmp.put_f32_le(self.z);
9571 __tmp.put_u16_le(self.command as u16);
9572 __tmp.put_u8(self.target_system);
9573 __tmp.put_u8(self.target_component);
9574 __tmp.put_u8(self.frame as u8);
9575 __tmp.put_u8(self.current);
9576 __tmp.put_u8(self.autocontinue);
9577 if matches!(version, MavlinkVersion::V2) {
9578 let len = __tmp.len();
9579 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9580 } else {
9581 __tmp.len()
9582 }
9583 }
9584}
9585#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9586#[doc = ""]
9587#[doc = "ID: 76"]
9588#[derive(Debug, Clone, PartialEq)]
9589#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9590#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9591#[cfg_attr(feature = "ts", derive(TS))]
9592#[cfg_attr(feature = "ts", ts(export))]
9593pub struct COMMAND_LONG_DATA {
9594 #[doc = "Parameter 1 (for the specific command)."]
9595 pub param1: f32,
9596 #[doc = "Parameter 2 (for the specific command)."]
9597 pub param2: f32,
9598 #[doc = "Parameter 3 (for the specific command)."]
9599 pub param3: f32,
9600 #[doc = "Parameter 4 (for the specific command)."]
9601 pub param4: f32,
9602 #[doc = "Parameter 5 (for the specific command)."]
9603 pub param5: f32,
9604 #[doc = "Parameter 6 (for the specific command)."]
9605 pub param6: f32,
9606 #[doc = "Parameter 7 (for the specific command)."]
9607 pub param7: f32,
9608 #[doc = "Command ID (of command to send)."]
9609 pub command: MavCmd,
9610 #[doc = "System which should execute the command"]
9611 pub target_system: u8,
9612 #[doc = "Component which should execute the command, 0 for all components"]
9613 pub target_component: u8,
9614 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9615 pub confirmation: u8,
9616}
9617impl COMMAND_LONG_DATA {
9618 pub const ENCODED_LEN: usize = 33usize;
9619 pub const DEFAULT: Self = Self {
9620 param1: 0.0_f32,
9621 param2: 0.0_f32,
9622 param3: 0.0_f32,
9623 param4: 0.0_f32,
9624 param5: 0.0_f32,
9625 param6: 0.0_f32,
9626 param7: 0.0_f32,
9627 command: MavCmd::DEFAULT,
9628 target_system: 0_u8,
9629 target_component: 0_u8,
9630 confirmation: 0_u8,
9631 };
9632 #[cfg(feature = "arbitrary")]
9633 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9634 use arbitrary::{Arbitrary, Unstructured};
9635 let mut buf = [0u8; 1024];
9636 rng.fill_bytes(&mut buf);
9637 let mut unstructured = Unstructured::new(&buf);
9638 Self::arbitrary(&mut unstructured).unwrap_or_default()
9639 }
9640}
9641impl Default for COMMAND_LONG_DATA {
9642 fn default() -> Self {
9643 Self::DEFAULT.clone()
9644 }
9645}
9646impl MessageData for COMMAND_LONG_DATA {
9647 type Message = MavMessage;
9648 const ID: u32 = 76u32;
9649 const NAME: &'static str = "COMMAND_LONG";
9650 const EXTRA_CRC: u8 = 152u8;
9651 const ENCODED_LEN: usize = 33usize;
9652 fn deser(
9653 _version: MavlinkVersion,
9654 __input: &[u8],
9655 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9656 let avail_len = __input.len();
9657 let mut payload_buf = [0; Self::ENCODED_LEN];
9658 let mut buf = if avail_len < Self::ENCODED_LEN {
9659 payload_buf[0..avail_len].copy_from_slice(__input);
9660 Bytes::new(&payload_buf)
9661 } else {
9662 Bytes::new(__input)
9663 };
9664 let mut __struct = Self::default();
9665 __struct.param1 = buf.get_f32_le();
9666 __struct.param2 = buf.get_f32_le();
9667 __struct.param3 = buf.get_f32_le();
9668 __struct.param4 = buf.get_f32_le();
9669 __struct.param5 = buf.get_f32_le();
9670 __struct.param6 = buf.get_f32_le();
9671 __struct.param7 = buf.get_f32_le();
9672 let tmp = buf.get_u16_le();
9673 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9674 ::mavlink_core::error::ParserError::InvalidEnum {
9675 enum_type: "MavCmd",
9676 value: tmp as u32,
9677 },
9678 )?;
9679 __struct.target_system = buf.get_u8();
9680 __struct.target_component = buf.get_u8();
9681 __struct.confirmation = buf.get_u8();
9682 Ok(__struct)
9683 }
9684 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9685 let mut __tmp = BytesMut::new(bytes);
9686 #[allow(clippy::absurd_extreme_comparisons)]
9687 #[allow(unused_comparisons)]
9688 if __tmp.remaining() < Self::ENCODED_LEN {
9689 panic!(
9690 "buffer is too small (need {} bytes, but got {})",
9691 Self::ENCODED_LEN,
9692 __tmp.remaining(),
9693 )
9694 }
9695 __tmp.put_f32_le(self.param1);
9696 __tmp.put_f32_le(self.param2);
9697 __tmp.put_f32_le(self.param3);
9698 __tmp.put_f32_le(self.param4);
9699 __tmp.put_f32_le(self.param5);
9700 __tmp.put_f32_le(self.param6);
9701 __tmp.put_f32_le(self.param7);
9702 __tmp.put_u16_le(self.command as u16);
9703 __tmp.put_u8(self.target_system);
9704 __tmp.put_u8(self.target_component);
9705 __tmp.put_u8(self.confirmation);
9706 if matches!(version, MavlinkVersion::V2) {
9707 let len = __tmp.len();
9708 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9709 } else {
9710 __tmp.len()
9711 }
9712 }
9713}
9714#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9715#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9716#[doc = ""]
9717#[doc = "ID: 395"]
9718#[derive(Debug, Clone, PartialEq)]
9719#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9720#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9721#[cfg_attr(feature = "ts", derive(TS))]
9722#[cfg_attr(feature = "ts", ts(export))]
9723pub struct COMPONENT_INFORMATION_DATA {
9724 #[doc = "Timestamp (time since system boot)."]
9725 pub time_boot_ms: u32,
9726 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9727 pub general_metadata_file_crc: u32,
9728 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9729 pub peripherals_metadata_file_crc: u32,
9730 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9731 #[cfg_attr(
9732 feature = "serde",
9733 serde(
9734 serialize_with = "crate::nulstr::serialize::<_, 100>",
9735 deserialize_with = "crate::nulstr::deserialize::<_, 100>"
9736 )
9737 )]
9738 #[cfg_attr(feature = "ts", ts(type = "string"))]
9739 pub general_metadata_uri: [u8; 100],
9740 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9741 #[cfg_attr(
9742 feature = "serde",
9743 serde(
9744 serialize_with = "crate::nulstr::serialize::<_, 100>",
9745 deserialize_with = "crate::nulstr::deserialize::<_, 100>"
9746 )
9747 )]
9748 #[cfg_attr(feature = "ts", ts(type = "string"))]
9749 pub peripherals_metadata_uri: [u8; 100],
9750}
9751impl COMPONENT_INFORMATION_DATA {
9752 pub const ENCODED_LEN: usize = 212usize;
9753 pub const DEFAULT: Self = Self {
9754 time_boot_ms: 0_u32,
9755 general_metadata_file_crc: 0_u32,
9756 peripherals_metadata_file_crc: 0_u32,
9757 general_metadata_uri: [0_u8; 100usize],
9758 peripherals_metadata_uri: [0_u8; 100usize],
9759 };
9760 #[cfg(feature = "arbitrary")]
9761 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9762 use arbitrary::{Arbitrary, Unstructured};
9763 let mut buf = [0u8; 1024];
9764 rng.fill_bytes(&mut buf);
9765 let mut unstructured = Unstructured::new(&buf);
9766 Self::arbitrary(&mut unstructured).unwrap_or_default()
9767 }
9768}
9769impl Default for COMPONENT_INFORMATION_DATA {
9770 fn default() -> Self {
9771 Self::DEFAULT.clone()
9772 }
9773}
9774impl MessageData for COMPONENT_INFORMATION_DATA {
9775 type Message = MavMessage;
9776 const ID: u32 = 395u32;
9777 const NAME: &'static str = "COMPONENT_INFORMATION";
9778 const EXTRA_CRC: u8 = 0u8;
9779 const ENCODED_LEN: usize = 212usize;
9780 fn deser(
9781 _version: MavlinkVersion,
9782 __input: &[u8],
9783 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9784 let avail_len = __input.len();
9785 let mut payload_buf = [0; Self::ENCODED_LEN];
9786 let mut buf = if avail_len < Self::ENCODED_LEN {
9787 payload_buf[0..avail_len].copy_from_slice(__input);
9788 Bytes::new(&payload_buf)
9789 } else {
9790 Bytes::new(__input)
9791 };
9792 let mut __struct = Self::default();
9793 __struct.time_boot_ms = buf.get_u32_le();
9794 __struct.general_metadata_file_crc = buf.get_u32_le();
9795 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9796 for v in &mut __struct.general_metadata_uri {
9797 let val = buf.get_u8();
9798 *v = val;
9799 }
9800 for v in &mut __struct.peripherals_metadata_uri {
9801 let val = buf.get_u8();
9802 *v = val;
9803 }
9804 Ok(__struct)
9805 }
9806 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9807 let mut __tmp = BytesMut::new(bytes);
9808 #[allow(clippy::absurd_extreme_comparisons)]
9809 #[allow(unused_comparisons)]
9810 if __tmp.remaining() < Self::ENCODED_LEN {
9811 panic!(
9812 "buffer is too small (need {} bytes, but got {})",
9813 Self::ENCODED_LEN,
9814 __tmp.remaining(),
9815 )
9816 }
9817 __tmp.put_u32_le(self.time_boot_ms);
9818 __tmp.put_u32_le(self.general_metadata_file_crc);
9819 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9820 for val in &self.general_metadata_uri {
9821 __tmp.put_u8(*val);
9822 }
9823 for val in &self.peripherals_metadata_uri {
9824 __tmp.put_u8(*val);
9825 }
9826 if matches!(version, MavlinkVersion::V2) {
9827 let len = __tmp.len();
9828 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9829 } else {
9830 __tmp.len()
9831 }
9832 }
9833}
9834#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9835#[doc = ""]
9836#[doc = "ID: 396"]
9837#[derive(Debug, Clone, PartialEq)]
9838#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9839#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9840#[cfg_attr(feature = "ts", derive(TS))]
9841#[cfg_attr(feature = "ts", ts(export))]
9842pub struct COMPONENT_INFORMATION_BASIC_DATA {
9843 #[doc = "Component capability flags"]
9844 pub capabilities: MavProtocolCapability,
9845 #[doc = "Timestamp (time since system boot)."]
9846 pub time_boot_ms: u32,
9847 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9848 pub time_manufacture_s: u32,
9849 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9850 #[cfg_attr(
9851 feature = "serde",
9852 serde(
9853 serialize_with = "crate::nulstr::serialize::<_, 32>",
9854 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
9855 )
9856 )]
9857 #[cfg_attr(feature = "ts", ts(type = "string"))]
9858 pub vendor_name: [u8; 32],
9859 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9860 #[cfg_attr(
9861 feature = "serde",
9862 serde(
9863 serialize_with = "crate::nulstr::serialize::<_, 32>",
9864 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
9865 )
9866 )]
9867 #[cfg_attr(feature = "ts", ts(type = "string"))]
9868 pub model_name: [u8; 32],
9869 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9870 #[cfg_attr(
9871 feature = "serde",
9872 serde(
9873 serialize_with = "crate::nulstr::serialize::<_, 24>",
9874 deserialize_with = "crate::nulstr::deserialize::<_, 24>"
9875 )
9876 )]
9877 #[cfg_attr(feature = "ts", ts(type = "string"))]
9878 pub software_version: [u8; 24],
9879 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9880 #[cfg_attr(
9881 feature = "serde",
9882 serde(
9883 serialize_with = "crate::nulstr::serialize::<_, 24>",
9884 deserialize_with = "crate::nulstr::deserialize::<_, 24>"
9885 )
9886 )]
9887 #[cfg_attr(feature = "ts", ts(type = "string"))]
9888 pub hardware_version: [u8; 24],
9889 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9890 #[cfg_attr(
9891 feature = "serde",
9892 serde(
9893 serialize_with = "crate::nulstr::serialize::<_, 32>",
9894 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
9895 )
9896 )]
9897 #[cfg_attr(feature = "ts", ts(type = "string"))]
9898 pub serial_number: [u8; 32],
9899}
9900impl COMPONENT_INFORMATION_BASIC_DATA {
9901 pub const ENCODED_LEN: usize = 160usize;
9902 pub const DEFAULT: Self = Self {
9903 capabilities: MavProtocolCapability::DEFAULT,
9904 time_boot_ms: 0_u32,
9905 time_manufacture_s: 0_u32,
9906 vendor_name: [0_u8; 32usize],
9907 model_name: [0_u8; 32usize],
9908 software_version: [0_u8; 24usize],
9909 hardware_version: [0_u8; 24usize],
9910 serial_number: [0_u8; 32usize],
9911 };
9912 #[cfg(feature = "arbitrary")]
9913 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9914 use arbitrary::{Arbitrary, Unstructured};
9915 let mut buf = [0u8; 1024];
9916 rng.fill_bytes(&mut buf);
9917 let mut unstructured = Unstructured::new(&buf);
9918 Self::arbitrary(&mut unstructured).unwrap_or_default()
9919 }
9920}
9921impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9922 fn default() -> Self {
9923 Self::DEFAULT.clone()
9924 }
9925}
9926impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9927 type Message = MavMessage;
9928 const ID: u32 = 396u32;
9929 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9930 const EXTRA_CRC: u8 = 50u8;
9931 const ENCODED_LEN: usize = 160usize;
9932 fn deser(
9933 _version: MavlinkVersion,
9934 __input: &[u8],
9935 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9936 let avail_len = __input.len();
9937 let mut payload_buf = [0; Self::ENCODED_LEN];
9938 let mut buf = if avail_len < Self::ENCODED_LEN {
9939 payload_buf[0..avail_len].copy_from_slice(__input);
9940 Bytes::new(&payload_buf)
9941 } else {
9942 Bytes::new(__input)
9943 };
9944 let mut __struct = Self::default();
9945 let tmp = buf.get_u64_le();
9946 __struct.capabilities = MavProtocolCapability::from_bits(
9947 tmp & MavProtocolCapability::all().bits(),
9948 )
9949 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9950 flag_type: "MavProtocolCapability",
9951 value: tmp as u32,
9952 })?;
9953 __struct.time_boot_ms = buf.get_u32_le();
9954 __struct.time_manufacture_s = buf.get_u32_le();
9955 for v in &mut __struct.vendor_name {
9956 let val = buf.get_u8();
9957 *v = val;
9958 }
9959 for v in &mut __struct.model_name {
9960 let val = buf.get_u8();
9961 *v = val;
9962 }
9963 for v in &mut __struct.software_version {
9964 let val = buf.get_u8();
9965 *v = val;
9966 }
9967 for v in &mut __struct.hardware_version {
9968 let val = buf.get_u8();
9969 *v = val;
9970 }
9971 for v in &mut __struct.serial_number {
9972 let val = buf.get_u8();
9973 *v = val;
9974 }
9975 Ok(__struct)
9976 }
9977 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9978 let mut __tmp = BytesMut::new(bytes);
9979 #[allow(clippy::absurd_extreme_comparisons)]
9980 #[allow(unused_comparisons)]
9981 if __tmp.remaining() < Self::ENCODED_LEN {
9982 panic!(
9983 "buffer is too small (need {} bytes, but got {})",
9984 Self::ENCODED_LEN,
9985 __tmp.remaining(),
9986 )
9987 }
9988 __tmp.put_u64_le(self.capabilities.bits());
9989 __tmp.put_u32_le(self.time_boot_ms);
9990 __tmp.put_u32_le(self.time_manufacture_s);
9991 for val in &self.vendor_name {
9992 __tmp.put_u8(*val);
9993 }
9994 for val in &self.model_name {
9995 __tmp.put_u8(*val);
9996 }
9997 for val in &self.software_version {
9998 __tmp.put_u8(*val);
9999 }
10000 for val in &self.hardware_version {
10001 __tmp.put_u8(*val);
10002 }
10003 for val in &self.serial_number {
10004 __tmp.put_u8(*val);
10005 }
10006 if matches!(version, MavlinkVersion::V2) {
10007 let len = __tmp.len();
10008 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10009 } else {
10010 __tmp.len()
10011 }
10012 }
10013}
10014#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
10015#[doc = ""]
10016#[doc = "ID: 397"]
10017#[derive(Debug, Clone, PartialEq)]
10018#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10019#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10020#[cfg_attr(feature = "ts", derive(TS))]
10021#[cfg_attr(feature = "ts", ts(export))]
10022pub struct COMPONENT_METADATA_DATA {
10023 #[doc = "Timestamp (time since system boot)."]
10024 pub time_boot_ms: u32,
10025 #[doc = "CRC32 of the general metadata file."]
10026 pub file_crc: u32,
10027 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
10028 #[cfg_attr(
10029 feature = "serde",
10030 serde(
10031 serialize_with = "crate::nulstr::serialize::<_, 100>",
10032 deserialize_with = "crate::nulstr::deserialize::<_, 100>"
10033 )
10034 )]
10035 #[cfg_attr(feature = "ts", ts(type = "string"))]
10036 pub uri: [u8; 100],
10037}
10038impl COMPONENT_METADATA_DATA {
10039 pub const ENCODED_LEN: usize = 108usize;
10040 pub const DEFAULT: Self = Self {
10041 time_boot_ms: 0_u32,
10042 file_crc: 0_u32,
10043 uri: [0_u8; 100usize],
10044 };
10045 #[cfg(feature = "arbitrary")]
10046 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10047 use arbitrary::{Arbitrary, Unstructured};
10048 let mut buf = [0u8; 1024];
10049 rng.fill_bytes(&mut buf);
10050 let mut unstructured = Unstructured::new(&buf);
10051 Self::arbitrary(&mut unstructured).unwrap_or_default()
10052 }
10053}
10054impl Default for COMPONENT_METADATA_DATA {
10055 fn default() -> Self {
10056 Self::DEFAULT.clone()
10057 }
10058}
10059impl MessageData for COMPONENT_METADATA_DATA {
10060 type Message = MavMessage;
10061 const ID: u32 = 397u32;
10062 const NAME: &'static str = "COMPONENT_METADATA";
10063 const EXTRA_CRC: u8 = 182u8;
10064 const ENCODED_LEN: usize = 108usize;
10065 fn deser(
10066 _version: MavlinkVersion,
10067 __input: &[u8],
10068 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10069 let avail_len = __input.len();
10070 let mut payload_buf = [0; Self::ENCODED_LEN];
10071 let mut buf = if avail_len < Self::ENCODED_LEN {
10072 payload_buf[0..avail_len].copy_from_slice(__input);
10073 Bytes::new(&payload_buf)
10074 } else {
10075 Bytes::new(__input)
10076 };
10077 let mut __struct = Self::default();
10078 __struct.time_boot_ms = buf.get_u32_le();
10079 __struct.file_crc = buf.get_u32_le();
10080 for v in &mut __struct.uri {
10081 let val = buf.get_u8();
10082 *v = val;
10083 }
10084 Ok(__struct)
10085 }
10086 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10087 let mut __tmp = BytesMut::new(bytes);
10088 #[allow(clippy::absurd_extreme_comparisons)]
10089 #[allow(unused_comparisons)]
10090 if __tmp.remaining() < Self::ENCODED_LEN {
10091 panic!(
10092 "buffer is too small (need {} bytes, but got {})",
10093 Self::ENCODED_LEN,
10094 __tmp.remaining(),
10095 )
10096 }
10097 __tmp.put_u32_le(self.time_boot_ms);
10098 __tmp.put_u32_le(self.file_crc);
10099 for val in &self.uri {
10100 __tmp.put_u8(*val);
10101 }
10102 if matches!(version, MavlinkVersion::V2) {
10103 let len = __tmp.len();
10104 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10105 } else {
10106 __tmp.len()
10107 }
10108 }
10109}
10110#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
10111#[doc = ""]
10112#[doc = "ID: 146"]
10113#[derive(Debug, Clone, PartialEq)]
10114#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10115#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10116#[cfg_attr(feature = "ts", derive(TS))]
10117#[cfg_attr(feature = "ts", ts(export))]
10118pub struct CONTROL_SYSTEM_STATE_DATA {
10119 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10120 pub time_usec: u64,
10121 #[doc = "X acceleration in body frame"]
10122 pub x_acc: f32,
10123 #[doc = "Y acceleration in body frame"]
10124 pub y_acc: f32,
10125 #[doc = "Z acceleration in body frame"]
10126 pub z_acc: f32,
10127 #[doc = "X velocity in body frame"]
10128 pub x_vel: f32,
10129 #[doc = "Y velocity in body frame"]
10130 pub y_vel: f32,
10131 #[doc = "Z velocity in body frame"]
10132 pub z_vel: f32,
10133 #[doc = "X position in local frame"]
10134 pub x_pos: f32,
10135 #[doc = "Y position in local frame"]
10136 pub y_pos: f32,
10137 #[doc = "Z position in local frame"]
10138 pub z_pos: f32,
10139 #[doc = "Airspeed, set to -1 if unknown"]
10140 pub airspeed: f32,
10141 #[doc = "Variance of body velocity estimate"]
10142 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10143 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10144 pub vel_variance: [f32; 3],
10145 #[doc = "Variance in local position"]
10146 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10147 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10148 pub pos_variance: [f32; 3],
10149 #[doc = "The attitude, represented as Quaternion"]
10150 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10151 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10152 pub q: [f32; 4],
10153 #[doc = "Angular rate in roll axis"]
10154 pub roll_rate: f32,
10155 #[doc = "Angular rate in pitch axis"]
10156 pub pitch_rate: f32,
10157 #[doc = "Angular rate in yaw axis"]
10158 pub yaw_rate: f32,
10159}
10160impl CONTROL_SYSTEM_STATE_DATA {
10161 pub const ENCODED_LEN: usize = 100usize;
10162 pub const DEFAULT: Self = Self {
10163 time_usec: 0_u64,
10164 x_acc: 0.0_f32,
10165 y_acc: 0.0_f32,
10166 z_acc: 0.0_f32,
10167 x_vel: 0.0_f32,
10168 y_vel: 0.0_f32,
10169 z_vel: 0.0_f32,
10170 x_pos: 0.0_f32,
10171 y_pos: 0.0_f32,
10172 z_pos: 0.0_f32,
10173 airspeed: 0.0_f32,
10174 vel_variance: [0.0_f32; 3usize],
10175 pos_variance: [0.0_f32; 3usize],
10176 q: [0.0_f32; 4usize],
10177 roll_rate: 0.0_f32,
10178 pitch_rate: 0.0_f32,
10179 yaw_rate: 0.0_f32,
10180 };
10181 #[cfg(feature = "arbitrary")]
10182 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10183 use arbitrary::{Arbitrary, Unstructured};
10184 let mut buf = [0u8; 1024];
10185 rng.fill_bytes(&mut buf);
10186 let mut unstructured = Unstructured::new(&buf);
10187 Self::arbitrary(&mut unstructured).unwrap_or_default()
10188 }
10189}
10190impl Default for CONTROL_SYSTEM_STATE_DATA {
10191 fn default() -> Self {
10192 Self::DEFAULT.clone()
10193 }
10194}
10195impl MessageData for CONTROL_SYSTEM_STATE_DATA {
10196 type Message = MavMessage;
10197 const ID: u32 = 146u32;
10198 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
10199 const EXTRA_CRC: u8 = 103u8;
10200 const ENCODED_LEN: usize = 100usize;
10201 fn deser(
10202 _version: MavlinkVersion,
10203 __input: &[u8],
10204 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10205 let avail_len = __input.len();
10206 let mut payload_buf = [0; Self::ENCODED_LEN];
10207 let mut buf = if avail_len < Self::ENCODED_LEN {
10208 payload_buf[0..avail_len].copy_from_slice(__input);
10209 Bytes::new(&payload_buf)
10210 } else {
10211 Bytes::new(__input)
10212 };
10213 let mut __struct = Self::default();
10214 __struct.time_usec = buf.get_u64_le();
10215 __struct.x_acc = buf.get_f32_le();
10216 __struct.y_acc = buf.get_f32_le();
10217 __struct.z_acc = buf.get_f32_le();
10218 __struct.x_vel = buf.get_f32_le();
10219 __struct.y_vel = buf.get_f32_le();
10220 __struct.z_vel = buf.get_f32_le();
10221 __struct.x_pos = buf.get_f32_le();
10222 __struct.y_pos = buf.get_f32_le();
10223 __struct.z_pos = buf.get_f32_le();
10224 __struct.airspeed = buf.get_f32_le();
10225 for v in &mut __struct.vel_variance {
10226 let val = buf.get_f32_le();
10227 *v = val;
10228 }
10229 for v in &mut __struct.pos_variance {
10230 let val = buf.get_f32_le();
10231 *v = val;
10232 }
10233 for v in &mut __struct.q {
10234 let val = buf.get_f32_le();
10235 *v = val;
10236 }
10237 __struct.roll_rate = buf.get_f32_le();
10238 __struct.pitch_rate = buf.get_f32_le();
10239 __struct.yaw_rate = buf.get_f32_le();
10240 Ok(__struct)
10241 }
10242 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10243 let mut __tmp = BytesMut::new(bytes);
10244 #[allow(clippy::absurd_extreme_comparisons)]
10245 #[allow(unused_comparisons)]
10246 if __tmp.remaining() < Self::ENCODED_LEN {
10247 panic!(
10248 "buffer is too small (need {} bytes, but got {})",
10249 Self::ENCODED_LEN,
10250 __tmp.remaining(),
10251 )
10252 }
10253 __tmp.put_u64_le(self.time_usec);
10254 __tmp.put_f32_le(self.x_acc);
10255 __tmp.put_f32_le(self.y_acc);
10256 __tmp.put_f32_le(self.z_acc);
10257 __tmp.put_f32_le(self.x_vel);
10258 __tmp.put_f32_le(self.y_vel);
10259 __tmp.put_f32_le(self.z_vel);
10260 __tmp.put_f32_le(self.x_pos);
10261 __tmp.put_f32_le(self.y_pos);
10262 __tmp.put_f32_le(self.z_pos);
10263 __tmp.put_f32_le(self.airspeed);
10264 for val in &self.vel_variance {
10265 __tmp.put_f32_le(*val);
10266 }
10267 for val in &self.pos_variance {
10268 __tmp.put_f32_le(*val);
10269 }
10270 for val in &self.q {
10271 __tmp.put_f32_le(*val);
10272 }
10273 __tmp.put_f32_le(self.roll_rate);
10274 __tmp.put_f32_le(self.pitch_rate);
10275 __tmp.put_f32_le(self.yaw_rate);
10276 if matches!(version, MavlinkVersion::V2) {
10277 let len = __tmp.len();
10278 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10279 } else {
10280 __tmp.len()
10281 }
10282 }
10283}
10284#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
10285#[doc = ""]
10286#[doc = "ID: 411"]
10287#[derive(Debug, Clone, PartialEq)]
10288#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10290#[cfg_attr(feature = "ts", derive(TS))]
10291#[cfg_attr(feature = "ts", ts(export))]
10292pub struct CURRENT_EVENT_SEQUENCE_DATA {
10293 #[doc = "Sequence number."]
10294 pub sequence: u16,
10295 #[doc = "Flag bitset."]
10296 pub flags: MavEventCurrentSequenceFlags,
10297}
10298impl CURRENT_EVENT_SEQUENCE_DATA {
10299 pub const ENCODED_LEN: usize = 3usize;
10300 pub const DEFAULT: Self = Self {
10301 sequence: 0_u16,
10302 flags: MavEventCurrentSequenceFlags::DEFAULT,
10303 };
10304 #[cfg(feature = "arbitrary")]
10305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10306 use arbitrary::{Arbitrary, Unstructured};
10307 let mut buf = [0u8; 1024];
10308 rng.fill_bytes(&mut buf);
10309 let mut unstructured = Unstructured::new(&buf);
10310 Self::arbitrary(&mut unstructured).unwrap_or_default()
10311 }
10312}
10313impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10314 fn default() -> Self {
10315 Self::DEFAULT.clone()
10316 }
10317}
10318impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10319 type Message = MavMessage;
10320 const ID: u32 = 411u32;
10321 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10322 const EXTRA_CRC: u8 = 106u8;
10323 const ENCODED_LEN: usize = 3usize;
10324 fn deser(
10325 _version: MavlinkVersion,
10326 __input: &[u8],
10327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10328 let avail_len = __input.len();
10329 let mut payload_buf = [0; Self::ENCODED_LEN];
10330 let mut buf = if avail_len < Self::ENCODED_LEN {
10331 payload_buf[0..avail_len].copy_from_slice(__input);
10332 Bytes::new(&payload_buf)
10333 } else {
10334 Bytes::new(__input)
10335 };
10336 let mut __struct = Self::default();
10337 __struct.sequence = buf.get_u16_le();
10338 let tmp = buf.get_u8();
10339 __struct.flags =
10340 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10341 enum_type: "MavEventCurrentSequenceFlags",
10342 value: tmp as u32,
10343 })?;
10344 Ok(__struct)
10345 }
10346 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10347 let mut __tmp = BytesMut::new(bytes);
10348 #[allow(clippy::absurd_extreme_comparisons)]
10349 #[allow(unused_comparisons)]
10350 if __tmp.remaining() < Self::ENCODED_LEN {
10351 panic!(
10352 "buffer is too small (need {} bytes, but got {})",
10353 Self::ENCODED_LEN,
10354 __tmp.remaining(),
10355 )
10356 }
10357 __tmp.put_u16_le(self.sequence);
10358 __tmp.put_u8(self.flags as u8);
10359 if matches!(version, MavlinkVersion::V2) {
10360 let len = __tmp.len();
10361 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10362 } else {
10363 __tmp.len()
10364 }
10365 }
10366}
10367#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10368#[doc = ""]
10369#[doc = "ID: 436"]
10370#[derive(Debug, Clone, PartialEq)]
10371#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10372#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10373#[cfg_attr(feature = "ts", derive(TS))]
10374#[cfg_attr(feature = "ts", ts(export))]
10375pub struct CURRENT_MODE_DATA {
10376 #[doc = "A bitfield for use for autopilot-specific flags"]
10377 pub custom_mode: u32,
10378 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10379 pub intended_custom_mode: u32,
10380 #[doc = "Standard mode."]
10381 pub standard_mode: MavStandardMode,
10382}
10383impl CURRENT_MODE_DATA {
10384 pub const ENCODED_LEN: usize = 9usize;
10385 pub const DEFAULT: Self = Self {
10386 custom_mode: 0_u32,
10387 intended_custom_mode: 0_u32,
10388 standard_mode: MavStandardMode::DEFAULT,
10389 };
10390 #[cfg(feature = "arbitrary")]
10391 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10392 use arbitrary::{Arbitrary, Unstructured};
10393 let mut buf = [0u8; 1024];
10394 rng.fill_bytes(&mut buf);
10395 let mut unstructured = Unstructured::new(&buf);
10396 Self::arbitrary(&mut unstructured).unwrap_or_default()
10397 }
10398}
10399impl Default for CURRENT_MODE_DATA {
10400 fn default() -> Self {
10401 Self::DEFAULT.clone()
10402 }
10403}
10404impl MessageData for CURRENT_MODE_DATA {
10405 type Message = MavMessage;
10406 const ID: u32 = 436u32;
10407 const NAME: &'static str = "CURRENT_MODE";
10408 const EXTRA_CRC: u8 = 193u8;
10409 const ENCODED_LEN: usize = 9usize;
10410 fn deser(
10411 _version: MavlinkVersion,
10412 __input: &[u8],
10413 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10414 let avail_len = __input.len();
10415 let mut payload_buf = [0; Self::ENCODED_LEN];
10416 let mut buf = if avail_len < Self::ENCODED_LEN {
10417 payload_buf[0..avail_len].copy_from_slice(__input);
10418 Bytes::new(&payload_buf)
10419 } else {
10420 Bytes::new(__input)
10421 };
10422 let mut __struct = Self::default();
10423 __struct.custom_mode = buf.get_u32_le();
10424 __struct.intended_custom_mode = buf.get_u32_le();
10425 let tmp = buf.get_u8();
10426 __struct.standard_mode =
10427 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10428 enum_type: "MavStandardMode",
10429 value: tmp as u32,
10430 })?;
10431 Ok(__struct)
10432 }
10433 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10434 let mut __tmp = BytesMut::new(bytes);
10435 #[allow(clippy::absurd_extreme_comparisons)]
10436 #[allow(unused_comparisons)]
10437 if __tmp.remaining() < Self::ENCODED_LEN {
10438 panic!(
10439 "buffer is too small (need {} bytes, but got {})",
10440 Self::ENCODED_LEN,
10441 __tmp.remaining(),
10442 )
10443 }
10444 __tmp.put_u32_le(self.custom_mode);
10445 __tmp.put_u32_le(self.intended_custom_mode);
10446 __tmp.put_u8(self.standard_mode as u8);
10447 if matches!(version, MavlinkVersion::V2) {
10448 let len = __tmp.len();
10449 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10450 } else {
10451 __tmp.len()
10452 }
10453 }
10454}
10455#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10456#[doc = "Data stream status information."]
10457#[doc = ""]
10458#[doc = "ID: 67"]
10459#[derive(Debug, Clone, PartialEq)]
10460#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10462#[cfg_attr(feature = "ts", derive(TS))]
10463#[cfg_attr(feature = "ts", ts(export))]
10464pub struct DATA_STREAM_DATA {
10465 #[doc = "The message rate"]
10466 pub message_rate: u16,
10467 #[doc = "The ID of the requested data stream"]
10468 pub stream_id: u8,
10469 #[doc = "1 stream is enabled, 0 stream is stopped."]
10470 pub on_off: u8,
10471}
10472impl DATA_STREAM_DATA {
10473 pub const ENCODED_LEN: usize = 4usize;
10474 pub const DEFAULT: Self = Self {
10475 message_rate: 0_u16,
10476 stream_id: 0_u8,
10477 on_off: 0_u8,
10478 };
10479 #[cfg(feature = "arbitrary")]
10480 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10481 use arbitrary::{Arbitrary, Unstructured};
10482 let mut buf = [0u8; 1024];
10483 rng.fill_bytes(&mut buf);
10484 let mut unstructured = Unstructured::new(&buf);
10485 Self::arbitrary(&mut unstructured).unwrap_or_default()
10486 }
10487}
10488impl Default for DATA_STREAM_DATA {
10489 fn default() -> Self {
10490 Self::DEFAULT.clone()
10491 }
10492}
10493impl MessageData for DATA_STREAM_DATA {
10494 type Message = MavMessage;
10495 const ID: u32 = 67u32;
10496 const NAME: &'static str = "DATA_STREAM";
10497 const EXTRA_CRC: u8 = 21u8;
10498 const ENCODED_LEN: usize = 4usize;
10499 fn deser(
10500 _version: MavlinkVersion,
10501 __input: &[u8],
10502 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10503 let avail_len = __input.len();
10504 let mut payload_buf = [0; Self::ENCODED_LEN];
10505 let mut buf = if avail_len < Self::ENCODED_LEN {
10506 payload_buf[0..avail_len].copy_from_slice(__input);
10507 Bytes::new(&payload_buf)
10508 } else {
10509 Bytes::new(__input)
10510 };
10511 let mut __struct = Self::default();
10512 __struct.message_rate = buf.get_u16_le();
10513 __struct.stream_id = buf.get_u8();
10514 __struct.on_off = buf.get_u8();
10515 Ok(__struct)
10516 }
10517 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10518 let mut __tmp = BytesMut::new(bytes);
10519 #[allow(clippy::absurd_extreme_comparisons)]
10520 #[allow(unused_comparisons)]
10521 if __tmp.remaining() < Self::ENCODED_LEN {
10522 panic!(
10523 "buffer is too small (need {} bytes, but got {})",
10524 Self::ENCODED_LEN,
10525 __tmp.remaining(),
10526 )
10527 }
10528 __tmp.put_u16_le(self.message_rate);
10529 __tmp.put_u8(self.stream_id);
10530 __tmp.put_u8(self.on_off);
10531 if matches!(version, MavlinkVersion::V2) {
10532 let len = __tmp.len();
10533 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10534 } else {
10535 __tmp.len()
10536 }
10537 }
10538}
10539#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10540#[doc = ""]
10541#[doc = "ID: 130"]
10542#[derive(Debug, Clone, PartialEq)]
10543#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10544#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10545#[cfg_attr(feature = "ts", derive(TS))]
10546#[cfg_attr(feature = "ts", ts(export))]
10547pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10548 #[doc = "total data size (set on ACK only)."]
10549 pub size: u32,
10550 #[doc = "Width of a matrix or image."]
10551 pub width: u16,
10552 #[doc = "Height of a matrix or image."]
10553 pub height: u16,
10554 #[doc = "Number of packets being sent (set on ACK only)."]
10555 pub packets: u16,
10556 #[doc = "Type of requested/acknowledged data."]
10557 pub mavtype: MavlinkDataStreamType,
10558 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10559 pub payload: u8,
10560 #[doc = "JPEG quality. Values: [1-100]."]
10561 pub jpg_quality: u8,
10562}
10563impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10564 pub const ENCODED_LEN: usize = 13usize;
10565 pub const DEFAULT: Self = Self {
10566 size: 0_u32,
10567 width: 0_u16,
10568 height: 0_u16,
10569 packets: 0_u16,
10570 mavtype: MavlinkDataStreamType::DEFAULT,
10571 payload: 0_u8,
10572 jpg_quality: 0_u8,
10573 };
10574 #[cfg(feature = "arbitrary")]
10575 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10576 use arbitrary::{Arbitrary, Unstructured};
10577 let mut buf = [0u8; 1024];
10578 rng.fill_bytes(&mut buf);
10579 let mut unstructured = Unstructured::new(&buf);
10580 Self::arbitrary(&mut unstructured).unwrap_or_default()
10581 }
10582}
10583impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10584 fn default() -> Self {
10585 Self::DEFAULT.clone()
10586 }
10587}
10588impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10589 type Message = MavMessage;
10590 const ID: u32 = 130u32;
10591 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10592 const EXTRA_CRC: u8 = 29u8;
10593 const ENCODED_LEN: usize = 13usize;
10594 fn deser(
10595 _version: MavlinkVersion,
10596 __input: &[u8],
10597 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10598 let avail_len = __input.len();
10599 let mut payload_buf = [0; Self::ENCODED_LEN];
10600 let mut buf = if avail_len < Self::ENCODED_LEN {
10601 payload_buf[0..avail_len].copy_from_slice(__input);
10602 Bytes::new(&payload_buf)
10603 } else {
10604 Bytes::new(__input)
10605 };
10606 let mut __struct = Self::default();
10607 __struct.size = buf.get_u32_le();
10608 __struct.width = buf.get_u16_le();
10609 __struct.height = buf.get_u16_le();
10610 __struct.packets = buf.get_u16_le();
10611 let tmp = buf.get_u8();
10612 __struct.mavtype =
10613 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10614 enum_type: "MavlinkDataStreamType",
10615 value: tmp as u32,
10616 })?;
10617 __struct.payload = buf.get_u8();
10618 __struct.jpg_quality = buf.get_u8();
10619 Ok(__struct)
10620 }
10621 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10622 let mut __tmp = BytesMut::new(bytes);
10623 #[allow(clippy::absurd_extreme_comparisons)]
10624 #[allow(unused_comparisons)]
10625 if __tmp.remaining() < Self::ENCODED_LEN {
10626 panic!(
10627 "buffer is too small (need {} bytes, but got {})",
10628 Self::ENCODED_LEN,
10629 __tmp.remaining(),
10630 )
10631 }
10632 __tmp.put_u32_le(self.size);
10633 __tmp.put_u16_le(self.width);
10634 __tmp.put_u16_le(self.height);
10635 __tmp.put_u16_le(self.packets);
10636 __tmp.put_u8(self.mavtype as u8);
10637 __tmp.put_u8(self.payload);
10638 __tmp.put_u8(self.jpg_quality);
10639 if matches!(version, MavlinkVersion::V2) {
10640 let len = __tmp.len();
10641 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10642 } else {
10643 __tmp.len()
10644 }
10645 }
10646}
10647#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10648#[doc = ""]
10649#[doc = "ID: 254"]
10650#[derive(Debug, Clone, PartialEq)]
10651#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10652#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10653#[cfg_attr(feature = "ts", derive(TS))]
10654#[cfg_attr(feature = "ts", ts(export))]
10655pub struct DEBUG_DATA {
10656 #[doc = "Timestamp (time since system boot)."]
10657 pub time_boot_ms: u32,
10658 #[doc = "DEBUG value"]
10659 pub value: f32,
10660 #[doc = "index of debug variable"]
10661 pub ind: u8,
10662}
10663impl DEBUG_DATA {
10664 pub const ENCODED_LEN: usize = 9usize;
10665 pub const DEFAULT: Self = Self {
10666 time_boot_ms: 0_u32,
10667 value: 0.0_f32,
10668 ind: 0_u8,
10669 };
10670 #[cfg(feature = "arbitrary")]
10671 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10672 use arbitrary::{Arbitrary, Unstructured};
10673 let mut buf = [0u8; 1024];
10674 rng.fill_bytes(&mut buf);
10675 let mut unstructured = Unstructured::new(&buf);
10676 Self::arbitrary(&mut unstructured).unwrap_or_default()
10677 }
10678}
10679impl Default for DEBUG_DATA {
10680 fn default() -> Self {
10681 Self::DEFAULT.clone()
10682 }
10683}
10684impl MessageData for DEBUG_DATA {
10685 type Message = MavMessage;
10686 const ID: u32 = 254u32;
10687 const NAME: &'static str = "DEBUG";
10688 const EXTRA_CRC: u8 = 46u8;
10689 const ENCODED_LEN: usize = 9usize;
10690 fn deser(
10691 _version: MavlinkVersion,
10692 __input: &[u8],
10693 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10694 let avail_len = __input.len();
10695 let mut payload_buf = [0; Self::ENCODED_LEN];
10696 let mut buf = if avail_len < Self::ENCODED_LEN {
10697 payload_buf[0..avail_len].copy_from_slice(__input);
10698 Bytes::new(&payload_buf)
10699 } else {
10700 Bytes::new(__input)
10701 };
10702 let mut __struct = Self::default();
10703 __struct.time_boot_ms = buf.get_u32_le();
10704 __struct.value = buf.get_f32_le();
10705 __struct.ind = buf.get_u8();
10706 Ok(__struct)
10707 }
10708 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10709 let mut __tmp = BytesMut::new(bytes);
10710 #[allow(clippy::absurd_extreme_comparisons)]
10711 #[allow(unused_comparisons)]
10712 if __tmp.remaining() < Self::ENCODED_LEN {
10713 panic!(
10714 "buffer is too small (need {} bytes, but got {})",
10715 Self::ENCODED_LEN,
10716 __tmp.remaining(),
10717 )
10718 }
10719 __tmp.put_u32_le(self.time_boot_ms);
10720 __tmp.put_f32_le(self.value);
10721 __tmp.put_u8(self.ind);
10722 if matches!(version, MavlinkVersion::V2) {
10723 let len = __tmp.len();
10724 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10725 } else {
10726 __tmp.len()
10727 }
10728 }
10729}
10730#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10731#[doc = ""]
10732#[doc = "ID: 350"]
10733#[derive(Debug, Clone, PartialEq)]
10734#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10735#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10736#[cfg_attr(feature = "ts", derive(TS))]
10737#[cfg_attr(feature = "ts", ts(export))]
10738pub struct DEBUG_FLOAT_ARRAY_DATA {
10739 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10740 pub time_usec: u64,
10741 #[doc = "Unique ID used to discriminate between arrays"]
10742 pub array_id: u16,
10743 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10744 #[cfg_attr(
10745 feature = "serde",
10746 serde(
10747 serialize_with = "crate::nulstr::serialize::<_, 10>",
10748 deserialize_with = "crate::nulstr::deserialize::<_, 10>"
10749 )
10750 )]
10751 #[cfg_attr(feature = "ts", ts(type = "string"))]
10752 pub name: [u8; 10],
10753 #[doc = "data"]
10754 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10755 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10756 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10757 pub data: [f32; 58],
10758}
10759impl DEBUG_FLOAT_ARRAY_DATA {
10760 pub const ENCODED_LEN: usize = 252usize;
10761 pub const DEFAULT: Self = Self {
10762 time_usec: 0_u64,
10763 array_id: 0_u16,
10764 name: [0_u8; 10usize],
10765 data: [0.0_f32; 58usize],
10766 };
10767 #[cfg(feature = "arbitrary")]
10768 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10769 use arbitrary::{Arbitrary, Unstructured};
10770 let mut buf = [0u8; 1024];
10771 rng.fill_bytes(&mut buf);
10772 let mut unstructured = Unstructured::new(&buf);
10773 Self::arbitrary(&mut unstructured).unwrap_or_default()
10774 }
10775}
10776impl Default for DEBUG_FLOAT_ARRAY_DATA {
10777 fn default() -> Self {
10778 Self::DEFAULT.clone()
10779 }
10780}
10781impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10782 type Message = MavMessage;
10783 const ID: u32 = 350u32;
10784 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10785 const EXTRA_CRC: u8 = 232u8;
10786 const ENCODED_LEN: usize = 252usize;
10787 fn deser(
10788 _version: MavlinkVersion,
10789 __input: &[u8],
10790 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10791 let avail_len = __input.len();
10792 let mut payload_buf = [0; Self::ENCODED_LEN];
10793 let mut buf = if avail_len < Self::ENCODED_LEN {
10794 payload_buf[0..avail_len].copy_from_slice(__input);
10795 Bytes::new(&payload_buf)
10796 } else {
10797 Bytes::new(__input)
10798 };
10799 let mut __struct = Self::default();
10800 __struct.time_usec = buf.get_u64_le();
10801 __struct.array_id = buf.get_u16_le();
10802 for v in &mut __struct.name {
10803 let val = buf.get_u8();
10804 *v = val;
10805 }
10806 for v in &mut __struct.data {
10807 let val = buf.get_f32_le();
10808 *v = val;
10809 }
10810 Ok(__struct)
10811 }
10812 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10813 let mut __tmp = BytesMut::new(bytes);
10814 #[allow(clippy::absurd_extreme_comparisons)]
10815 #[allow(unused_comparisons)]
10816 if __tmp.remaining() < Self::ENCODED_LEN {
10817 panic!(
10818 "buffer is too small (need {} bytes, but got {})",
10819 Self::ENCODED_LEN,
10820 __tmp.remaining(),
10821 )
10822 }
10823 __tmp.put_u64_le(self.time_usec);
10824 __tmp.put_u16_le(self.array_id);
10825 for val in &self.name {
10826 __tmp.put_u8(*val);
10827 }
10828 if matches!(version, MavlinkVersion::V2) {
10829 for val in &self.data {
10830 __tmp.put_f32_le(*val);
10831 }
10832 let len = __tmp.len();
10833 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10834 } else {
10835 __tmp.len()
10836 }
10837 }
10838}
10839#[doc = "To debug something using a named 3D vector."]
10840#[doc = ""]
10841#[doc = "ID: 250"]
10842#[derive(Debug, Clone, PartialEq)]
10843#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10844#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10845#[cfg_attr(feature = "ts", derive(TS))]
10846#[cfg_attr(feature = "ts", ts(export))]
10847pub struct DEBUG_VECT_DATA {
10848 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10849 pub time_usec: u64,
10850 #[doc = "x"]
10851 pub x: f32,
10852 #[doc = "y"]
10853 pub y: f32,
10854 #[doc = "z"]
10855 pub z: f32,
10856 #[doc = "Name"]
10857 #[cfg_attr(
10858 feature = "serde",
10859 serde(
10860 serialize_with = "crate::nulstr::serialize::<_, 10>",
10861 deserialize_with = "crate::nulstr::deserialize::<_, 10>"
10862 )
10863 )]
10864 #[cfg_attr(feature = "ts", ts(type = "string"))]
10865 pub name: [u8; 10],
10866}
10867impl DEBUG_VECT_DATA {
10868 pub const ENCODED_LEN: usize = 30usize;
10869 pub const DEFAULT: Self = Self {
10870 time_usec: 0_u64,
10871 x: 0.0_f32,
10872 y: 0.0_f32,
10873 z: 0.0_f32,
10874 name: [0_u8; 10usize],
10875 };
10876 #[cfg(feature = "arbitrary")]
10877 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10878 use arbitrary::{Arbitrary, Unstructured};
10879 let mut buf = [0u8; 1024];
10880 rng.fill_bytes(&mut buf);
10881 let mut unstructured = Unstructured::new(&buf);
10882 Self::arbitrary(&mut unstructured).unwrap_or_default()
10883 }
10884}
10885impl Default for DEBUG_VECT_DATA {
10886 fn default() -> Self {
10887 Self::DEFAULT.clone()
10888 }
10889}
10890impl MessageData for DEBUG_VECT_DATA {
10891 type Message = MavMessage;
10892 const ID: u32 = 250u32;
10893 const NAME: &'static str = "DEBUG_VECT";
10894 const EXTRA_CRC: u8 = 49u8;
10895 const ENCODED_LEN: usize = 30usize;
10896 fn deser(
10897 _version: MavlinkVersion,
10898 __input: &[u8],
10899 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10900 let avail_len = __input.len();
10901 let mut payload_buf = [0; Self::ENCODED_LEN];
10902 let mut buf = if avail_len < Self::ENCODED_LEN {
10903 payload_buf[0..avail_len].copy_from_slice(__input);
10904 Bytes::new(&payload_buf)
10905 } else {
10906 Bytes::new(__input)
10907 };
10908 let mut __struct = Self::default();
10909 __struct.time_usec = buf.get_u64_le();
10910 __struct.x = buf.get_f32_le();
10911 __struct.y = buf.get_f32_le();
10912 __struct.z = buf.get_f32_le();
10913 for v in &mut __struct.name {
10914 let val = buf.get_u8();
10915 *v = val;
10916 }
10917 Ok(__struct)
10918 }
10919 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10920 let mut __tmp = BytesMut::new(bytes);
10921 #[allow(clippy::absurd_extreme_comparisons)]
10922 #[allow(unused_comparisons)]
10923 if __tmp.remaining() < Self::ENCODED_LEN {
10924 panic!(
10925 "buffer is too small (need {} bytes, but got {})",
10926 Self::ENCODED_LEN,
10927 __tmp.remaining(),
10928 )
10929 }
10930 __tmp.put_u64_le(self.time_usec);
10931 __tmp.put_f32_le(self.x);
10932 __tmp.put_f32_le(self.y);
10933 __tmp.put_f32_le(self.z);
10934 for val in &self.name {
10935 __tmp.put_u8(*val);
10936 }
10937 if matches!(version, MavlinkVersion::V2) {
10938 let len = __tmp.len();
10939 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10940 } else {
10941 __tmp.len()
10942 }
10943 }
10944}
10945#[doc = "Distance sensor information for an onboard rangefinder."]
10946#[doc = ""]
10947#[doc = "ID: 132"]
10948#[derive(Debug, Clone, PartialEq)]
10949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10950#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10951#[cfg_attr(feature = "ts", derive(TS))]
10952#[cfg_attr(feature = "ts", ts(export))]
10953pub struct DISTANCE_SENSOR_DATA {
10954 #[doc = "Timestamp (time since system boot)."]
10955 pub time_boot_ms: u32,
10956 #[doc = "Minimum distance the sensor can measure"]
10957 pub min_distance: u16,
10958 #[doc = "Maximum distance the sensor can measure"]
10959 pub max_distance: u16,
10960 #[doc = "Current distance reading"]
10961 pub current_distance: u16,
10962 #[doc = "Type of distance sensor."]
10963 pub mavtype: MavDistanceSensor,
10964 #[doc = "Onboard ID of the sensor"]
10965 pub id: u8,
10966 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10967 pub orientation: MavSensorOrientation,
10968 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10969 pub covariance: u8,
10970 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10971 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10972 pub horizontal_fov: f32,
10973 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10974 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10975 pub vertical_fov: f32,
10976 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10977 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10978 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10979 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10980 pub quaternion: [f32; 4],
10981 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10982 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10983 pub signal_quality: u8,
10984}
10985impl DISTANCE_SENSOR_DATA {
10986 pub const ENCODED_LEN: usize = 39usize;
10987 pub const DEFAULT: Self = Self {
10988 time_boot_ms: 0_u32,
10989 min_distance: 0_u16,
10990 max_distance: 0_u16,
10991 current_distance: 0_u16,
10992 mavtype: MavDistanceSensor::DEFAULT,
10993 id: 0_u8,
10994 orientation: MavSensorOrientation::DEFAULT,
10995 covariance: 0_u8,
10996 horizontal_fov: 0.0_f32,
10997 vertical_fov: 0.0_f32,
10998 quaternion: [0.0_f32; 4usize],
10999 signal_quality: 0_u8,
11000 };
11001 #[cfg(feature = "arbitrary")]
11002 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11003 use arbitrary::{Arbitrary, Unstructured};
11004 let mut buf = [0u8; 1024];
11005 rng.fill_bytes(&mut buf);
11006 let mut unstructured = Unstructured::new(&buf);
11007 Self::arbitrary(&mut unstructured).unwrap_or_default()
11008 }
11009}
11010impl Default for DISTANCE_SENSOR_DATA {
11011 fn default() -> Self {
11012 Self::DEFAULT.clone()
11013 }
11014}
11015impl MessageData for DISTANCE_SENSOR_DATA {
11016 type Message = MavMessage;
11017 const ID: u32 = 132u32;
11018 const NAME: &'static str = "DISTANCE_SENSOR";
11019 const EXTRA_CRC: u8 = 85u8;
11020 const ENCODED_LEN: usize = 39usize;
11021 fn deser(
11022 _version: MavlinkVersion,
11023 __input: &[u8],
11024 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11025 let avail_len = __input.len();
11026 let mut payload_buf = [0; Self::ENCODED_LEN];
11027 let mut buf = if avail_len < Self::ENCODED_LEN {
11028 payload_buf[0..avail_len].copy_from_slice(__input);
11029 Bytes::new(&payload_buf)
11030 } else {
11031 Bytes::new(__input)
11032 };
11033 let mut __struct = Self::default();
11034 __struct.time_boot_ms = buf.get_u32_le();
11035 __struct.min_distance = buf.get_u16_le();
11036 __struct.max_distance = buf.get_u16_le();
11037 __struct.current_distance = buf.get_u16_le();
11038 let tmp = buf.get_u8();
11039 __struct.mavtype =
11040 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11041 enum_type: "MavDistanceSensor",
11042 value: tmp as u32,
11043 })?;
11044 __struct.id = buf.get_u8();
11045 let tmp = buf.get_u8();
11046 __struct.orientation =
11047 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11048 enum_type: "MavSensorOrientation",
11049 value: tmp as u32,
11050 })?;
11051 __struct.covariance = buf.get_u8();
11052 __struct.horizontal_fov = buf.get_f32_le();
11053 __struct.vertical_fov = buf.get_f32_le();
11054 for v in &mut __struct.quaternion {
11055 let val = buf.get_f32_le();
11056 *v = val;
11057 }
11058 __struct.signal_quality = buf.get_u8();
11059 Ok(__struct)
11060 }
11061 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11062 let mut __tmp = BytesMut::new(bytes);
11063 #[allow(clippy::absurd_extreme_comparisons)]
11064 #[allow(unused_comparisons)]
11065 if __tmp.remaining() < Self::ENCODED_LEN {
11066 panic!(
11067 "buffer is too small (need {} bytes, but got {})",
11068 Self::ENCODED_LEN,
11069 __tmp.remaining(),
11070 )
11071 }
11072 __tmp.put_u32_le(self.time_boot_ms);
11073 __tmp.put_u16_le(self.min_distance);
11074 __tmp.put_u16_le(self.max_distance);
11075 __tmp.put_u16_le(self.current_distance);
11076 __tmp.put_u8(self.mavtype as u8);
11077 __tmp.put_u8(self.id);
11078 __tmp.put_u8(self.orientation as u8);
11079 __tmp.put_u8(self.covariance);
11080 if matches!(version, MavlinkVersion::V2) {
11081 __tmp.put_f32_le(self.horizontal_fov);
11082 __tmp.put_f32_le(self.vertical_fov);
11083 for val in &self.quaternion {
11084 __tmp.put_f32_le(*val);
11085 }
11086 __tmp.put_u8(self.signal_quality);
11087 let len = __tmp.len();
11088 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11089 } else {
11090 __tmp.len()
11091 }
11092 }
11093}
11094#[doc = "EFI status output."]
11095#[doc = ""]
11096#[doc = "ID: 225"]
11097#[derive(Debug, Clone, PartialEq)]
11098#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11099#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11100#[cfg_attr(feature = "ts", derive(TS))]
11101#[cfg_attr(feature = "ts", ts(export))]
11102pub struct EFI_STATUS_DATA {
11103 #[doc = "ECU index"]
11104 pub ecu_index: f32,
11105 #[doc = "RPM"]
11106 pub rpm: f32,
11107 #[doc = "Fuel consumed"]
11108 pub fuel_consumed: f32,
11109 #[doc = "Fuel flow rate"]
11110 pub fuel_flow: f32,
11111 #[doc = "Engine load"]
11112 pub engine_load: f32,
11113 #[doc = "Throttle position"]
11114 pub throttle_position: f32,
11115 #[doc = "Spark dwell time"]
11116 pub spark_dwell_time: f32,
11117 #[doc = "Barometric pressure"]
11118 pub barometric_pressure: f32,
11119 #[doc = "Intake manifold pressure("]
11120 pub intake_manifold_pressure: f32,
11121 #[doc = "Intake manifold temperature"]
11122 pub intake_manifold_temperature: f32,
11123 #[doc = "Cylinder head temperature"]
11124 pub cylinder_head_temperature: f32,
11125 #[doc = "Ignition timing (Crank angle degrees)"]
11126 pub ignition_timing: f32,
11127 #[doc = "Injection time"]
11128 pub injection_time: f32,
11129 #[doc = "Exhaust gas temperature"]
11130 pub exhaust_gas_temperature: f32,
11131 #[doc = "Output throttle"]
11132 pub throttle_out: f32,
11133 #[doc = "Pressure/temperature compensation"]
11134 pub pt_compensation: f32,
11135 #[doc = "EFI health status"]
11136 pub health: u8,
11137 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
11138 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11139 pub ignition_voltage: f32,
11140 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
11141 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11142 pub fuel_pressure: f32,
11143}
11144impl EFI_STATUS_DATA {
11145 pub const ENCODED_LEN: usize = 73usize;
11146 pub const DEFAULT: Self = Self {
11147 ecu_index: 0.0_f32,
11148 rpm: 0.0_f32,
11149 fuel_consumed: 0.0_f32,
11150 fuel_flow: 0.0_f32,
11151 engine_load: 0.0_f32,
11152 throttle_position: 0.0_f32,
11153 spark_dwell_time: 0.0_f32,
11154 barometric_pressure: 0.0_f32,
11155 intake_manifold_pressure: 0.0_f32,
11156 intake_manifold_temperature: 0.0_f32,
11157 cylinder_head_temperature: 0.0_f32,
11158 ignition_timing: 0.0_f32,
11159 injection_time: 0.0_f32,
11160 exhaust_gas_temperature: 0.0_f32,
11161 throttle_out: 0.0_f32,
11162 pt_compensation: 0.0_f32,
11163 health: 0_u8,
11164 ignition_voltage: 0.0_f32,
11165 fuel_pressure: 0.0_f32,
11166 };
11167 #[cfg(feature = "arbitrary")]
11168 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11169 use arbitrary::{Arbitrary, Unstructured};
11170 let mut buf = [0u8; 1024];
11171 rng.fill_bytes(&mut buf);
11172 let mut unstructured = Unstructured::new(&buf);
11173 Self::arbitrary(&mut unstructured).unwrap_or_default()
11174 }
11175}
11176impl Default for EFI_STATUS_DATA {
11177 fn default() -> Self {
11178 Self::DEFAULT.clone()
11179 }
11180}
11181impl MessageData for EFI_STATUS_DATA {
11182 type Message = MavMessage;
11183 const ID: u32 = 225u32;
11184 const NAME: &'static str = "EFI_STATUS";
11185 const EXTRA_CRC: u8 = 208u8;
11186 const ENCODED_LEN: usize = 73usize;
11187 fn deser(
11188 _version: MavlinkVersion,
11189 __input: &[u8],
11190 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11191 let avail_len = __input.len();
11192 let mut payload_buf = [0; Self::ENCODED_LEN];
11193 let mut buf = if avail_len < Self::ENCODED_LEN {
11194 payload_buf[0..avail_len].copy_from_slice(__input);
11195 Bytes::new(&payload_buf)
11196 } else {
11197 Bytes::new(__input)
11198 };
11199 let mut __struct = Self::default();
11200 __struct.ecu_index = buf.get_f32_le();
11201 __struct.rpm = buf.get_f32_le();
11202 __struct.fuel_consumed = buf.get_f32_le();
11203 __struct.fuel_flow = buf.get_f32_le();
11204 __struct.engine_load = buf.get_f32_le();
11205 __struct.throttle_position = buf.get_f32_le();
11206 __struct.spark_dwell_time = buf.get_f32_le();
11207 __struct.barometric_pressure = buf.get_f32_le();
11208 __struct.intake_manifold_pressure = buf.get_f32_le();
11209 __struct.intake_manifold_temperature = buf.get_f32_le();
11210 __struct.cylinder_head_temperature = buf.get_f32_le();
11211 __struct.ignition_timing = buf.get_f32_le();
11212 __struct.injection_time = buf.get_f32_le();
11213 __struct.exhaust_gas_temperature = buf.get_f32_le();
11214 __struct.throttle_out = buf.get_f32_le();
11215 __struct.pt_compensation = buf.get_f32_le();
11216 __struct.health = buf.get_u8();
11217 __struct.ignition_voltage = buf.get_f32_le();
11218 __struct.fuel_pressure = buf.get_f32_le();
11219 Ok(__struct)
11220 }
11221 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11222 let mut __tmp = BytesMut::new(bytes);
11223 #[allow(clippy::absurd_extreme_comparisons)]
11224 #[allow(unused_comparisons)]
11225 if __tmp.remaining() < Self::ENCODED_LEN {
11226 panic!(
11227 "buffer is too small (need {} bytes, but got {})",
11228 Self::ENCODED_LEN,
11229 __tmp.remaining(),
11230 )
11231 }
11232 __tmp.put_f32_le(self.ecu_index);
11233 __tmp.put_f32_le(self.rpm);
11234 __tmp.put_f32_le(self.fuel_consumed);
11235 __tmp.put_f32_le(self.fuel_flow);
11236 __tmp.put_f32_le(self.engine_load);
11237 __tmp.put_f32_le(self.throttle_position);
11238 __tmp.put_f32_le(self.spark_dwell_time);
11239 __tmp.put_f32_le(self.barometric_pressure);
11240 __tmp.put_f32_le(self.intake_manifold_pressure);
11241 __tmp.put_f32_le(self.intake_manifold_temperature);
11242 __tmp.put_f32_le(self.cylinder_head_temperature);
11243 __tmp.put_f32_le(self.ignition_timing);
11244 __tmp.put_f32_le(self.injection_time);
11245 __tmp.put_f32_le(self.exhaust_gas_temperature);
11246 __tmp.put_f32_le(self.throttle_out);
11247 __tmp.put_f32_le(self.pt_compensation);
11248 __tmp.put_u8(self.health);
11249 if matches!(version, MavlinkVersion::V2) {
11250 __tmp.put_f32_le(self.ignition_voltage);
11251 __tmp.put_f32_le(self.fuel_pressure);
11252 let len = __tmp.len();
11253 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11254 } else {
11255 __tmp.len()
11256 }
11257 }
11258}
11259#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11260#[doc = ""]
11261#[doc = "ID: 131"]
11262#[derive(Debug, Clone, PartialEq)]
11263#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11264#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11265#[cfg_attr(feature = "ts", derive(TS))]
11266#[cfg_attr(feature = "ts", ts(export))]
11267pub struct ENCAPSULATED_DATA_DATA {
11268 #[doc = "sequence number (starting with 0 on every transmission)"]
11269 pub seqnr: u16,
11270 #[doc = "image data bytes"]
11271 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11272 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11273 pub data: [u8; 253],
11274}
11275impl ENCAPSULATED_DATA_DATA {
11276 pub const ENCODED_LEN: usize = 255usize;
11277 pub const DEFAULT: Self = Self {
11278 seqnr: 0_u16,
11279 data: [0_u8; 253usize],
11280 };
11281 #[cfg(feature = "arbitrary")]
11282 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11283 use arbitrary::{Arbitrary, Unstructured};
11284 let mut buf = [0u8; 1024];
11285 rng.fill_bytes(&mut buf);
11286 let mut unstructured = Unstructured::new(&buf);
11287 Self::arbitrary(&mut unstructured).unwrap_or_default()
11288 }
11289}
11290impl Default for ENCAPSULATED_DATA_DATA {
11291 fn default() -> Self {
11292 Self::DEFAULT.clone()
11293 }
11294}
11295impl MessageData for ENCAPSULATED_DATA_DATA {
11296 type Message = MavMessage;
11297 const ID: u32 = 131u32;
11298 const NAME: &'static str = "ENCAPSULATED_DATA";
11299 const EXTRA_CRC: u8 = 223u8;
11300 const ENCODED_LEN: usize = 255usize;
11301 fn deser(
11302 _version: MavlinkVersion,
11303 __input: &[u8],
11304 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11305 let avail_len = __input.len();
11306 let mut payload_buf = [0; Self::ENCODED_LEN];
11307 let mut buf = if avail_len < Self::ENCODED_LEN {
11308 payload_buf[0..avail_len].copy_from_slice(__input);
11309 Bytes::new(&payload_buf)
11310 } else {
11311 Bytes::new(__input)
11312 };
11313 let mut __struct = Self::default();
11314 __struct.seqnr = buf.get_u16_le();
11315 for v in &mut __struct.data {
11316 let val = buf.get_u8();
11317 *v = val;
11318 }
11319 Ok(__struct)
11320 }
11321 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11322 let mut __tmp = BytesMut::new(bytes);
11323 #[allow(clippy::absurd_extreme_comparisons)]
11324 #[allow(unused_comparisons)]
11325 if __tmp.remaining() < Self::ENCODED_LEN {
11326 panic!(
11327 "buffer is too small (need {} bytes, but got {})",
11328 Self::ENCODED_LEN,
11329 __tmp.remaining(),
11330 )
11331 }
11332 __tmp.put_u16_le(self.seqnr);
11333 for val in &self.data {
11334 __tmp.put_u8(*val);
11335 }
11336 if matches!(version, MavlinkVersion::V2) {
11337 let len = __tmp.len();
11338 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11339 } else {
11340 __tmp.len()
11341 }
11342 }
11343}
11344#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11345#[doc = ""]
11346#[doc = "ID: 290"]
11347#[derive(Debug, Clone, PartialEq)]
11348#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11349#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11350#[cfg_attr(feature = "ts", derive(TS))]
11351#[cfg_attr(feature = "ts", ts(export))]
11352pub struct ESC_INFO_DATA {
11353 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11354 pub time_usec: u64,
11355 #[doc = "Number of reported errors by each ESC since boot."]
11356 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11357 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11358 pub error_count: [u32; 4],
11359 #[doc = "Counter of data packets received."]
11360 pub counter: u16,
11361 #[doc = "Bitmap of ESC failure flags."]
11362 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11363 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11364 pub failure_flags: [u16; 4],
11365 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11366 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11367 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11368 pub temperature: [i16; 4],
11369 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11370 pub index: u8,
11371 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11372 pub count: u8,
11373 #[doc = "Connection type protocol for all ESC."]
11374 pub connection_type: EscConnectionType,
11375 #[doc = "Information regarding online/offline status of each ESC."]
11376 pub info: u8,
11377}
11378impl ESC_INFO_DATA {
11379 pub const ENCODED_LEN: usize = 46usize;
11380 pub const DEFAULT: Self = Self {
11381 time_usec: 0_u64,
11382 error_count: [0_u32; 4usize],
11383 counter: 0_u16,
11384 failure_flags: [0_u16; 4usize],
11385 temperature: [0_i16; 4usize],
11386 index: 0_u8,
11387 count: 0_u8,
11388 connection_type: EscConnectionType::DEFAULT,
11389 info: 0_u8,
11390 };
11391 #[cfg(feature = "arbitrary")]
11392 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11393 use arbitrary::{Arbitrary, Unstructured};
11394 let mut buf = [0u8; 1024];
11395 rng.fill_bytes(&mut buf);
11396 let mut unstructured = Unstructured::new(&buf);
11397 Self::arbitrary(&mut unstructured).unwrap_or_default()
11398 }
11399}
11400impl Default for ESC_INFO_DATA {
11401 fn default() -> Self {
11402 Self::DEFAULT.clone()
11403 }
11404}
11405impl MessageData for ESC_INFO_DATA {
11406 type Message = MavMessage;
11407 const ID: u32 = 290u32;
11408 const NAME: &'static str = "ESC_INFO";
11409 const EXTRA_CRC: u8 = 251u8;
11410 const ENCODED_LEN: usize = 46usize;
11411 fn deser(
11412 _version: MavlinkVersion,
11413 __input: &[u8],
11414 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11415 let avail_len = __input.len();
11416 let mut payload_buf = [0; Self::ENCODED_LEN];
11417 let mut buf = if avail_len < Self::ENCODED_LEN {
11418 payload_buf[0..avail_len].copy_from_slice(__input);
11419 Bytes::new(&payload_buf)
11420 } else {
11421 Bytes::new(__input)
11422 };
11423 let mut __struct = Self::default();
11424 __struct.time_usec = buf.get_u64_le();
11425 for v in &mut __struct.error_count {
11426 let val = buf.get_u32_le();
11427 *v = val;
11428 }
11429 __struct.counter = buf.get_u16_le();
11430 for v in &mut __struct.failure_flags {
11431 let val = buf.get_u16_le();
11432 *v = val;
11433 }
11434 for v in &mut __struct.temperature {
11435 let val = buf.get_i16_le();
11436 *v = val;
11437 }
11438 __struct.index = buf.get_u8();
11439 __struct.count = buf.get_u8();
11440 let tmp = buf.get_u8();
11441 __struct.connection_type =
11442 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11443 enum_type: "EscConnectionType",
11444 value: tmp as u32,
11445 })?;
11446 __struct.info = buf.get_u8();
11447 Ok(__struct)
11448 }
11449 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11450 let mut __tmp = BytesMut::new(bytes);
11451 #[allow(clippy::absurd_extreme_comparisons)]
11452 #[allow(unused_comparisons)]
11453 if __tmp.remaining() < Self::ENCODED_LEN {
11454 panic!(
11455 "buffer is too small (need {} bytes, but got {})",
11456 Self::ENCODED_LEN,
11457 __tmp.remaining(),
11458 )
11459 }
11460 __tmp.put_u64_le(self.time_usec);
11461 for val in &self.error_count {
11462 __tmp.put_u32_le(*val);
11463 }
11464 __tmp.put_u16_le(self.counter);
11465 for val in &self.failure_flags {
11466 __tmp.put_u16_le(*val);
11467 }
11468 for val in &self.temperature {
11469 __tmp.put_i16_le(*val);
11470 }
11471 __tmp.put_u8(self.index);
11472 __tmp.put_u8(self.count);
11473 __tmp.put_u8(self.connection_type as u8);
11474 __tmp.put_u8(self.info);
11475 if matches!(version, MavlinkVersion::V2) {
11476 let len = __tmp.len();
11477 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11478 } else {
11479 __tmp.len()
11480 }
11481 }
11482}
11483#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11484#[doc = ""]
11485#[doc = "ID: 291"]
11486#[derive(Debug, Clone, PartialEq)]
11487#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11488#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11489#[cfg_attr(feature = "ts", derive(TS))]
11490#[cfg_attr(feature = "ts", ts(export))]
11491pub struct ESC_STATUS_DATA {
11492 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11493 pub time_usec: u64,
11494 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11495 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11496 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11497 pub rpm: [i32; 4],
11498 #[doc = "Voltage measured from each ESC."]
11499 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11500 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11501 pub voltage: [f32; 4],
11502 #[doc = "Current measured from each ESC."]
11503 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11504 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11505 pub current: [f32; 4],
11506 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11507 pub index: u8,
11508}
11509impl ESC_STATUS_DATA {
11510 pub const ENCODED_LEN: usize = 57usize;
11511 pub const DEFAULT: Self = Self {
11512 time_usec: 0_u64,
11513 rpm: [0_i32; 4usize],
11514 voltage: [0.0_f32; 4usize],
11515 current: [0.0_f32; 4usize],
11516 index: 0_u8,
11517 };
11518 #[cfg(feature = "arbitrary")]
11519 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11520 use arbitrary::{Arbitrary, Unstructured};
11521 let mut buf = [0u8; 1024];
11522 rng.fill_bytes(&mut buf);
11523 let mut unstructured = Unstructured::new(&buf);
11524 Self::arbitrary(&mut unstructured).unwrap_or_default()
11525 }
11526}
11527impl Default for ESC_STATUS_DATA {
11528 fn default() -> Self {
11529 Self::DEFAULT.clone()
11530 }
11531}
11532impl MessageData for ESC_STATUS_DATA {
11533 type Message = MavMessage;
11534 const ID: u32 = 291u32;
11535 const NAME: &'static str = "ESC_STATUS";
11536 const EXTRA_CRC: u8 = 10u8;
11537 const ENCODED_LEN: usize = 57usize;
11538 fn deser(
11539 _version: MavlinkVersion,
11540 __input: &[u8],
11541 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11542 let avail_len = __input.len();
11543 let mut payload_buf = [0; Self::ENCODED_LEN];
11544 let mut buf = if avail_len < Self::ENCODED_LEN {
11545 payload_buf[0..avail_len].copy_from_slice(__input);
11546 Bytes::new(&payload_buf)
11547 } else {
11548 Bytes::new(__input)
11549 };
11550 let mut __struct = Self::default();
11551 __struct.time_usec = buf.get_u64_le();
11552 for v in &mut __struct.rpm {
11553 let val = buf.get_i32_le();
11554 *v = val;
11555 }
11556 for v in &mut __struct.voltage {
11557 let val = buf.get_f32_le();
11558 *v = val;
11559 }
11560 for v in &mut __struct.current {
11561 let val = buf.get_f32_le();
11562 *v = val;
11563 }
11564 __struct.index = buf.get_u8();
11565 Ok(__struct)
11566 }
11567 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11568 let mut __tmp = BytesMut::new(bytes);
11569 #[allow(clippy::absurd_extreme_comparisons)]
11570 #[allow(unused_comparisons)]
11571 if __tmp.remaining() < Self::ENCODED_LEN {
11572 panic!(
11573 "buffer is too small (need {} bytes, but got {})",
11574 Self::ENCODED_LEN,
11575 __tmp.remaining(),
11576 )
11577 }
11578 __tmp.put_u64_le(self.time_usec);
11579 for val in &self.rpm {
11580 __tmp.put_i32_le(*val);
11581 }
11582 for val in &self.voltage {
11583 __tmp.put_f32_le(*val);
11584 }
11585 for val in &self.current {
11586 __tmp.put_f32_le(*val);
11587 }
11588 __tmp.put_u8(self.index);
11589 if matches!(version, MavlinkVersion::V2) {
11590 let len = __tmp.len();
11591 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11592 } else {
11593 __tmp.len()
11594 }
11595 }
11596}
11597#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11598#[doc = ""]
11599#[doc = "ID: 230"]
11600#[derive(Debug, Clone, PartialEq)]
11601#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11602#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11603#[cfg_attr(feature = "ts", derive(TS))]
11604#[cfg_attr(feature = "ts", ts(export))]
11605pub struct ESTIMATOR_STATUS_DATA {
11606 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11607 pub time_usec: u64,
11608 #[doc = "Velocity innovation test ratio"]
11609 pub vel_ratio: f32,
11610 #[doc = "Horizontal position innovation test ratio"]
11611 pub pos_horiz_ratio: f32,
11612 #[doc = "Vertical position innovation test ratio"]
11613 pub pos_vert_ratio: f32,
11614 #[doc = "Magnetometer innovation test ratio"]
11615 pub mag_ratio: f32,
11616 #[doc = "Height above terrain innovation test ratio"]
11617 pub hagl_ratio: f32,
11618 #[doc = "True airspeed innovation test ratio"]
11619 pub tas_ratio: f32,
11620 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11621 pub pos_horiz_accuracy: f32,
11622 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11623 pub pos_vert_accuracy: f32,
11624 #[doc = "Bitmap indicating which EKF outputs are valid."]
11625 pub flags: EstimatorStatusFlags,
11626}
11627impl ESTIMATOR_STATUS_DATA {
11628 pub const ENCODED_LEN: usize = 42usize;
11629 pub const DEFAULT: Self = Self {
11630 time_usec: 0_u64,
11631 vel_ratio: 0.0_f32,
11632 pos_horiz_ratio: 0.0_f32,
11633 pos_vert_ratio: 0.0_f32,
11634 mag_ratio: 0.0_f32,
11635 hagl_ratio: 0.0_f32,
11636 tas_ratio: 0.0_f32,
11637 pos_horiz_accuracy: 0.0_f32,
11638 pos_vert_accuracy: 0.0_f32,
11639 flags: EstimatorStatusFlags::DEFAULT,
11640 };
11641 #[cfg(feature = "arbitrary")]
11642 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11643 use arbitrary::{Arbitrary, Unstructured};
11644 let mut buf = [0u8; 1024];
11645 rng.fill_bytes(&mut buf);
11646 let mut unstructured = Unstructured::new(&buf);
11647 Self::arbitrary(&mut unstructured).unwrap_or_default()
11648 }
11649}
11650impl Default for ESTIMATOR_STATUS_DATA {
11651 fn default() -> Self {
11652 Self::DEFAULT.clone()
11653 }
11654}
11655impl MessageData for ESTIMATOR_STATUS_DATA {
11656 type Message = MavMessage;
11657 const ID: u32 = 230u32;
11658 const NAME: &'static str = "ESTIMATOR_STATUS";
11659 const EXTRA_CRC: u8 = 163u8;
11660 const ENCODED_LEN: usize = 42usize;
11661 fn deser(
11662 _version: MavlinkVersion,
11663 __input: &[u8],
11664 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11665 let avail_len = __input.len();
11666 let mut payload_buf = [0; Self::ENCODED_LEN];
11667 let mut buf = if avail_len < Self::ENCODED_LEN {
11668 payload_buf[0..avail_len].copy_from_slice(__input);
11669 Bytes::new(&payload_buf)
11670 } else {
11671 Bytes::new(__input)
11672 };
11673 let mut __struct = Self::default();
11674 __struct.time_usec = buf.get_u64_le();
11675 __struct.vel_ratio = buf.get_f32_le();
11676 __struct.pos_horiz_ratio = buf.get_f32_le();
11677 __struct.pos_vert_ratio = buf.get_f32_le();
11678 __struct.mag_ratio = buf.get_f32_le();
11679 __struct.hagl_ratio = buf.get_f32_le();
11680 __struct.tas_ratio = buf.get_f32_le();
11681 __struct.pos_horiz_accuracy = buf.get_f32_le();
11682 __struct.pos_vert_accuracy = buf.get_f32_le();
11683 let tmp = buf.get_u16_le();
11684 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
11685 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11686 flag_type: "EstimatorStatusFlags",
11687 value: tmp as u32,
11688 })?;
11689 Ok(__struct)
11690 }
11691 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11692 let mut __tmp = BytesMut::new(bytes);
11693 #[allow(clippy::absurd_extreme_comparisons)]
11694 #[allow(unused_comparisons)]
11695 if __tmp.remaining() < Self::ENCODED_LEN {
11696 panic!(
11697 "buffer is too small (need {} bytes, but got {})",
11698 Self::ENCODED_LEN,
11699 __tmp.remaining(),
11700 )
11701 }
11702 __tmp.put_u64_le(self.time_usec);
11703 __tmp.put_f32_le(self.vel_ratio);
11704 __tmp.put_f32_le(self.pos_horiz_ratio);
11705 __tmp.put_f32_le(self.pos_vert_ratio);
11706 __tmp.put_f32_le(self.mag_ratio);
11707 __tmp.put_f32_le(self.hagl_ratio);
11708 __tmp.put_f32_le(self.tas_ratio);
11709 __tmp.put_f32_le(self.pos_horiz_accuracy);
11710 __tmp.put_f32_le(self.pos_vert_accuracy);
11711 __tmp.put_u16_le(self.flags.bits());
11712 if matches!(version, MavlinkVersion::V2) {
11713 let len = __tmp.len();
11714 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11715 } else {
11716 __tmp.len()
11717 }
11718 }
11719}
11720#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11721#[doc = ""]
11722#[doc = "ID: 410"]
11723#[derive(Debug, Clone, PartialEq)]
11724#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11725#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11726#[cfg_attr(feature = "ts", derive(TS))]
11727#[cfg_attr(feature = "ts", ts(export))]
11728pub struct EVENT_DATA {
11729 #[doc = "Event ID (as defined in the component metadata)"]
11730 pub id: u32,
11731 #[doc = "Timestamp (time since system boot when the event happened)."]
11732 pub event_time_boot_ms: u32,
11733 #[doc = "Sequence number."]
11734 pub sequence: u16,
11735 #[doc = "Component ID"]
11736 pub destination_component: u8,
11737 #[doc = "System ID"]
11738 pub destination_system: u8,
11739 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11740 pub log_levels: u8,
11741 #[doc = "Arguments (depend on event ID)."]
11742 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11743 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11744 pub arguments: [u8; 40],
11745}
11746impl EVENT_DATA {
11747 pub const ENCODED_LEN: usize = 53usize;
11748 pub const DEFAULT: Self = Self {
11749 id: 0_u32,
11750 event_time_boot_ms: 0_u32,
11751 sequence: 0_u16,
11752 destination_component: 0_u8,
11753 destination_system: 0_u8,
11754 log_levels: 0_u8,
11755 arguments: [0_u8; 40usize],
11756 };
11757 #[cfg(feature = "arbitrary")]
11758 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11759 use arbitrary::{Arbitrary, Unstructured};
11760 let mut buf = [0u8; 1024];
11761 rng.fill_bytes(&mut buf);
11762 let mut unstructured = Unstructured::new(&buf);
11763 Self::arbitrary(&mut unstructured).unwrap_or_default()
11764 }
11765}
11766impl Default for EVENT_DATA {
11767 fn default() -> Self {
11768 Self::DEFAULT.clone()
11769 }
11770}
11771impl MessageData for EVENT_DATA {
11772 type Message = MavMessage;
11773 const ID: u32 = 410u32;
11774 const NAME: &'static str = "EVENT";
11775 const EXTRA_CRC: u8 = 160u8;
11776 const ENCODED_LEN: usize = 53usize;
11777 fn deser(
11778 _version: MavlinkVersion,
11779 __input: &[u8],
11780 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11781 let avail_len = __input.len();
11782 let mut payload_buf = [0; Self::ENCODED_LEN];
11783 let mut buf = if avail_len < Self::ENCODED_LEN {
11784 payload_buf[0..avail_len].copy_from_slice(__input);
11785 Bytes::new(&payload_buf)
11786 } else {
11787 Bytes::new(__input)
11788 };
11789 let mut __struct = Self::default();
11790 __struct.id = buf.get_u32_le();
11791 __struct.event_time_boot_ms = buf.get_u32_le();
11792 __struct.sequence = buf.get_u16_le();
11793 __struct.destination_component = buf.get_u8();
11794 __struct.destination_system = buf.get_u8();
11795 __struct.log_levels = buf.get_u8();
11796 for v in &mut __struct.arguments {
11797 let val = buf.get_u8();
11798 *v = val;
11799 }
11800 Ok(__struct)
11801 }
11802 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11803 let mut __tmp = BytesMut::new(bytes);
11804 #[allow(clippy::absurd_extreme_comparisons)]
11805 #[allow(unused_comparisons)]
11806 if __tmp.remaining() < Self::ENCODED_LEN {
11807 panic!(
11808 "buffer is too small (need {} bytes, but got {})",
11809 Self::ENCODED_LEN,
11810 __tmp.remaining(),
11811 )
11812 }
11813 __tmp.put_u32_le(self.id);
11814 __tmp.put_u32_le(self.event_time_boot_ms);
11815 __tmp.put_u16_le(self.sequence);
11816 __tmp.put_u8(self.destination_component);
11817 __tmp.put_u8(self.destination_system);
11818 __tmp.put_u8(self.log_levels);
11819 for val in &self.arguments {
11820 __tmp.put_u8(*val);
11821 }
11822 if matches!(version, MavlinkVersion::V2) {
11823 let len = __tmp.len();
11824 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11825 } else {
11826 __tmp.len()
11827 }
11828 }
11829}
11830#[doc = "Provides state for additional features."]
11831#[doc = ""]
11832#[doc = "ID: 245"]
11833#[derive(Debug, Clone, PartialEq)]
11834#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11835#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11836#[cfg_attr(feature = "ts", derive(TS))]
11837#[cfg_attr(feature = "ts", ts(export))]
11838pub struct EXTENDED_SYS_STATE_DATA {
11839 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11840 pub vtol_state: MavVtolState,
11841 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11842 pub landed_state: MavLandedState,
11843}
11844impl EXTENDED_SYS_STATE_DATA {
11845 pub const ENCODED_LEN: usize = 2usize;
11846 pub const DEFAULT: Self = Self {
11847 vtol_state: MavVtolState::DEFAULT,
11848 landed_state: MavLandedState::DEFAULT,
11849 };
11850 #[cfg(feature = "arbitrary")]
11851 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11852 use arbitrary::{Arbitrary, Unstructured};
11853 let mut buf = [0u8; 1024];
11854 rng.fill_bytes(&mut buf);
11855 let mut unstructured = Unstructured::new(&buf);
11856 Self::arbitrary(&mut unstructured).unwrap_or_default()
11857 }
11858}
11859impl Default for EXTENDED_SYS_STATE_DATA {
11860 fn default() -> Self {
11861 Self::DEFAULT.clone()
11862 }
11863}
11864impl MessageData for EXTENDED_SYS_STATE_DATA {
11865 type Message = MavMessage;
11866 const ID: u32 = 245u32;
11867 const NAME: &'static str = "EXTENDED_SYS_STATE";
11868 const EXTRA_CRC: u8 = 130u8;
11869 const ENCODED_LEN: usize = 2usize;
11870 fn deser(
11871 _version: MavlinkVersion,
11872 __input: &[u8],
11873 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11874 let avail_len = __input.len();
11875 let mut payload_buf = [0; Self::ENCODED_LEN];
11876 let mut buf = if avail_len < Self::ENCODED_LEN {
11877 payload_buf[0..avail_len].copy_from_slice(__input);
11878 Bytes::new(&payload_buf)
11879 } else {
11880 Bytes::new(__input)
11881 };
11882 let mut __struct = Self::default();
11883 let tmp = buf.get_u8();
11884 __struct.vtol_state =
11885 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11886 enum_type: "MavVtolState",
11887 value: tmp as u32,
11888 })?;
11889 let tmp = buf.get_u8();
11890 __struct.landed_state =
11891 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11892 enum_type: "MavLandedState",
11893 value: tmp as u32,
11894 })?;
11895 Ok(__struct)
11896 }
11897 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11898 let mut __tmp = BytesMut::new(bytes);
11899 #[allow(clippy::absurd_extreme_comparisons)]
11900 #[allow(unused_comparisons)]
11901 if __tmp.remaining() < Self::ENCODED_LEN {
11902 panic!(
11903 "buffer is too small (need {} bytes, but got {})",
11904 Self::ENCODED_LEN,
11905 __tmp.remaining(),
11906 )
11907 }
11908 __tmp.put_u8(self.vtol_state as u8);
11909 __tmp.put_u8(self.landed_state as u8);
11910 if matches!(version, MavlinkVersion::V2) {
11911 let len = __tmp.len();
11912 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11913 } else {
11914 __tmp.len()
11915 }
11916 }
11917}
11918#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11919#[doc = ""]
11920#[doc = "ID: 162"]
11921#[derive(Debug, Clone, PartialEq)]
11922#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11924#[cfg_attr(feature = "ts", derive(TS))]
11925#[cfg_attr(feature = "ts", ts(export))]
11926pub struct FENCE_STATUS_DATA {
11927 #[doc = "Time (since boot) of last breach."]
11928 pub breach_time: u32,
11929 #[doc = "Number of fence breaches."]
11930 pub breach_count: u16,
11931 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11932 pub breach_status: u8,
11933 #[doc = "Last breach type."]
11934 pub breach_type: FenceBreach,
11935 #[doc = "Active action to prevent fence breach"]
11936 #[cfg_attr(feature = "serde", serde(default))]
11937 pub breach_mitigation: FenceMitigate,
11938}
11939impl FENCE_STATUS_DATA {
11940 pub const ENCODED_LEN: usize = 9usize;
11941 pub const DEFAULT: Self = Self {
11942 breach_time: 0_u32,
11943 breach_count: 0_u16,
11944 breach_status: 0_u8,
11945 breach_type: FenceBreach::DEFAULT,
11946 breach_mitigation: FenceMitigate::DEFAULT,
11947 };
11948 #[cfg(feature = "arbitrary")]
11949 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11950 use arbitrary::{Arbitrary, Unstructured};
11951 let mut buf = [0u8; 1024];
11952 rng.fill_bytes(&mut buf);
11953 let mut unstructured = Unstructured::new(&buf);
11954 Self::arbitrary(&mut unstructured).unwrap_or_default()
11955 }
11956}
11957impl Default for FENCE_STATUS_DATA {
11958 fn default() -> Self {
11959 Self::DEFAULT.clone()
11960 }
11961}
11962impl MessageData for FENCE_STATUS_DATA {
11963 type Message = MavMessage;
11964 const ID: u32 = 162u32;
11965 const NAME: &'static str = "FENCE_STATUS";
11966 const EXTRA_CRC: u8 = 189u8;
11967 const ENCODED_LEN: usize = 9usize;
11968 fn deser(
11969 _version: MavlinkVersion,
11970 __input: &[u8],
11971 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11972 let avail_len = __input.len();
11973 let mut payload_buf = [0; Self::ENCODED_LEN];
11974 let mut buf = if avail_len < Self::ENCODED_LEN {
11975 payload_buf[0..avail_len].copy_from_slice(__input);
11976 Bytes::new(&payload_buf)
11977 } else {
11978 Bytes::new(__input)
11979 };
11980 let mut __struct = Self::default();
11981 __struct.breach_time = buf.get_u32_le();
11982 __struct.breach_count = buf.get_u16_le();
11983 __struct.breach_status = buf.get_u8();
11984 let tmp = buf.get_u8();
11985 __struct.breach_type =
11986 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11987 enum_type: "FenceBreach",
11988 value: tmp as u32,
11989 })?;
11990 let tmp = buf.get_u8();
11991 __struct.breach_mitigation =
11992 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11993 enum_type: "FenceMitigate",
11994 value: tmp as u32,
11995 })?;
11996 Ok(__struct)
11997 }
11998 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11999 let mut __tmp = BytesMut::new(bytes);
12000 #[allow(clippy::absurd_extreme_comparisons)]
12001 #[allow(unused_comparisons)]
12002 if __tmp.remaining() < Self::ENCODED_LEN {
12003 panic!(
12004 "buffer is too small (need {} bytes, but got {})",
12005 Self::ENCODED_LEN,
12006 __tmp.remaining(),
12007 )
12008 }
12009 __tmp.put_u32_le(self.breach_time);
12010 __tmp.put_u16_le(self.breach_count);
12011 __tmp.put_u8(self.breach_status);
12012 __tmp.put_u8(self.breach_type as u8);
12013 if matches!(version, MavlinkVersion::V2) {
12014 __tmp.put_u8(self.breach_mitigation as u8);
12015 let len = __tmp.len();
12016 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12017 } else {
12018 __tmp.len()
12019 }
12020 }
12021}
12022#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
12023#[doc = ""]
12024#[doc = "ID: 110"]
12025#[derive(Debug, Clone, PartialEq)]
12026#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12027#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12028#[cfg_attr(feature = "ts", derive(TS))]
12029#[cfg_attr(feature = "ts", ts(export))]
12030pub struct FILE_TRANSFER_PROTOCOL_DATA {
12031 #[doc = "Network ID (0 for broadcast)"]
12032 pub target_network: u8,
12033 #[doc = "System ID (0 for broadcast)"]
12034 pub target_system: u8,
12035 #[doc = "Component ID (0 for broadcast)"]
12036 pub target_component: u8,
12037 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
12038 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12039 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12040 pub payload: [u8; 251],
12041}
12042impl FILE_TRANSFER_PROTOCOL_DATA {
12043 pub const ENCODED_LEN: usize = 254usize;
12044 pub const DEFAULT: Self = Self {
12045 target_network: 0_u8,
12046 target_system: 0_u8,
12047 target_component: 0_u8,
12048 payload: [0_u8; 251usize],
12049 };
12050 #[cfg(feature = "arbitrary")]
12051 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12052 use arbitrary::{Arbitrary, Unstructured};
12053 let mut buf = [0u8; 1024];
12054 rng.fill_bytes(&mut buf);
12055 let mut unstructured = Unstructured::new(&buf);
12056 Self::arbitrary(&mut unstructured).unwrap_or_default()
12057 }
12058}
12059impl Default for FILE_TRANSFER_PROTOCOL_DATA {
12060 fn default() -> Self {
12061 Self::DEFAULT.clone()
12062 }
12063}
12064impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
12065 type Message = MavMessage;
12066 const ID: u32 = 110u32;
12067 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
12068 const EXTRA_CRC: u8 = 84u8;
12069 const ENCODED_LEN: usize = 254usize;
12070 fn deser(
12071 _version: MavlinkVersion,
12072 __input: &[u8],
12073 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12074 let avail_len = __input.len();
12075 let mut payload_buf = [0; Self::ENCODED_LEN];
12076 let mut buf = if avail_len < Self::ENCODED_LEN {
12077 payload_buf[0..avail_len].copy_from_slice(__input);
12078 Bytes::new(&payload_buf)
12079 } else {
12080 Bytes::new(__input)
12081 };
12082 let mut __struct = Self::default();
12083 __struct.target_network = buf.get_u8();
12084 __struct.target_system = buf.get_u8();
12085 __struct.target_component = buf.get_u8();
12086 for v in &mut __struct.payload {
12087 let val = buf.get_u8();
12088 *v = val;
12089 }
12090 Ok(__struct)
12091 }
12092 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12093 let mut __tmp = BytesMut::new(bytes);
12094 #[allow(clippy::absurd_extreme_comparisons)]
12095 #[allow(unused_comparisons)]
12096 if __tmp.remaining() < Self::ENCODED_LEN {
12097 panic!(
12098 "buffer is too small (need {} bytes, but got {})",
12099 Self::ENCODED_LEN,
12100 __tmp.remaining(),
12101 )
12102 }
12103 __tmp.put_u8(self.target_network);
12104 __tmp.put_u8(self.target_system);
12105 __tmp.put_u8(self.target_component);
12106 for val in &self.payload {
12107 __tmp.put_u8(*val);
12108 }
12109 if matches!(version, MavlinkVersion::V2) {
12110 let len = __tmp.len();
12111 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12112 } else {
12113 __tmp.len()
12114 }
12115 }
12116}
12117#[doc = "Flexifunction type and parameters for component at function index from buffer."]
12118#[doc = ""]
12119#[doc = "ID: 152"]
12120#[derive(Debug, Clone, PartialEq)]
12121#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12122#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12123#[cfg_attr(feature = "ts", derive(TS))]
12124#[cfg_attr(feature = "ts", ts(export))]
12125pub struct FLEXIFUNCTION_BUFFER_FUNCTION_DATA {
12126 #[doc = "Function index"]
12127 pub func_index: u16,
12128 #[doc = "Total count of functions"]
12129 pub func_count: u16,
12130 #[doc = "Address in the flexifunction data, Set to 0xFFFF to use address in target memory"]
12131 pub data_address: u16,
12132 #[doc = "Size of the"]
12133 pub data_size: u16,
12134 #[doc = "System ID"]
12135 pub target_system: u8,
12136 #[doc = "Component ID"]
12137 pub target_component: u8,
12138 #[doc = "Settings data"]
12139 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12140 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12141 pub data: [i8; 48],
12142}
12143impl FLEXIFUNCTION_BUFFER_FUNCTION_DATA {
12144 pub const ENCODED_LEN: usize = 58usize;
12145 pub const DEFAULT: Self = Self {
12146 func_index: 0_u16,
12147 func_count: 0_u16,
12148 data_address: 0_u16,
12149 data_size: 0_u16,
12150 target_system: 0_u8,
12151 target_component: 0_u8,
12152 data: [0_i8; 48usize],
12153 };
12154 #[cfg(feature = "arbitrary")]
12155 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12156 use arbitrary::{Arbitrary, Unstructured};
12157 let mut buf = [0u8; 1024];
12158 rng.fill_bytes(&mut buf);
12159 let mut unstructured = Unstructured::new(&buf);
12160 Self::arbitrary(&mut unstructured).unwrap_or_default()
12161 }
12162}
12163impl Default for FLEXIFUNCTION_BUFFER_FUNCTION_DATA {
12164 fn default() -> Self {
12165 Self::DEFAULT.clone()
12166 }
12167}
12168impl MessageData for FLEXIFUNCTION_BUFFER_FUNCTION_DATA {
12169 type Message = MavMessage;
12170 const ID: u32 = 152u32;
12171 const NAME: &'static str = "FLEXIFUNCTION_BUFFER_FUNCTION";
12172 const EXTRA_CRC: u8 = 101u8;
12173 const ENCODED_LEN: usize = 58usize;
12174 fn deser(
12175 _version: MavlinkVersion,
12176 __input: &[u8],
12177 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12178 let avail_len = __input.len();
12179 let mut payload_buf = [0; Self::ENCODED_LEN];
12180 let mut buf = if avail_len < Self::ENCODED_LEN {
12181 payload_buf[0..avail_len].copy_from_slice(__input);
12182 Bytes::new(&payload_buf)
12183 } else {
12184 Bytes::new(__input)
12185 };
12186 let mut __struct = Self::default();
12187 __struct.func_index = buf.get_u16_le();
12188 __struct.func_count = buf.get_u16_le();
12189 __struct.data_address = buf.get_u16_le();
12190 __struct.data_size = buf.get_u16_le();
12191 __struct.target_system = buf.get_u8();
12192 __struct.target_component = buf.get_u8();
12193 for v in &mut __struct.data {
12194 let val = buf.get_i8();
12195 *v = val;
12196 }
12197 Ok(__struct)
12198 }
12199 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12200 let mut __tmp = BytesMut::new(bytes);
12201 #[allow(clippy::absurd_extreme_comparisons)]
12202 #[allow(unused_comparisons)]
12203 if __tmp.remaining() < Self::ENCODED_LEN {
12204 panic!(
12205 "buffer is too small (need {} bytes, but got {})",
12206 Self::ENCODED_LEN,
12207 __tmp.remaining(),
12208 )
12209 }
12210 __tmp.put_u16_le(self.func_index);
12211 __tmp.put_u16_le(self.func_count);
12212 __tmp.put_u16_le(self.data_address);
12213 __tmp.put_u16_le(self.data_size);
12214 __tmp.put_u8(self.target_system);
12215 __tmp.put_u8(self.target_component);
12216 for val in &self.data {
12217 __tmp.put_i8(*val);
12218 }
12219 if matches!(version, MavlinkVersion::V2) {
12220 let len = __tmp.len();
12221 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12222 } else {
12223 __tmp.len()
12224 }
12225 }
12226}
12227#[doc = "Flexifunction type and parameters for component at function index from buffer."]
12228#[doc = ""]
12229#[doc = "ID: 153"]
12230#[derive(Debug, Clone, PartialEq)]
12231#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12232#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12233#[cfg_attr(feature = "ts", derive(TS))]
12234#[cfg_attr(feature = "ts", ts(export))]
12235pub struct FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA {
12236 #[doc = "Function index"]
12237 pub func_index: u16,
12238 #[doc = "result of acknowledge, 0=fail, 1=good"]
12239 pub result: u16,
12240 #[doc = "System ID"]
12241 pub target_system: u8,
12242 #[doc = "Component ID"]
12243 pub target_component: u8,
12244}
12245impl FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA {
12246 pub const ENCODED_LEN: usize = 6usize;
12247 pub const DEFAULT: Self = Self {
12248 func_index: 0_u16,
12249 result: 0_u16,
12250 target_system: 0_u8,
12251 target_component: 0_u8,
12252 };
12253 #[cfg(feature = "arbitrary")]
12254 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12255 use arbitrary::{Arbitrary, Unstructured};
12256 let mut buf = [0u8; 1024];
12257 rng.fill_bytes(&mut buf);
12258 let mut unstructured = Unstructured::new(&buf);
12259 Self::arbitrary(&mut unstructured).unwrap_or_default()
12260 }
12261}
12262impl Default for FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA {
12263 fn default() -> Self {
12264 Self::DEFAULT.clone()
12265 }
12266}
12267impl MessageData for FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA {
12268 type Message = MavMessage;
12269 const ID: u32 = 153u32;
12270 const NAME: &'static str = "FLEXIFUNCTION_BUFFER_FUNCTION_ACK";
12271 const EXTRA_CRC: u8 = 109u8;
12272 const ENCODED_LEN: usize = 6usize;
12273 fn deser(
12274 _version: MavlinkVersion,
12275 __input: &[u8],
12276 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12277 let avail_len = __input.len();
12278 let mut payload_buf = [0; Self::ENCODED_LEN];
12279 let mut buf = if avail_len < Self::ENCODED_LEN {
12280 payload_buf[0..avail_len].copy_from_slice(__input);
12281 Bytes::new(&payload_buf)
12282 } else {
12283 Bytes::new(__input)
12284 };
12285 let mut __struct = Self::default();
12286 __struct.func_index = buf.get_u16_le();
12287 __struct.result = buf.get_u16_le();
12288 __struct.target_system = buf.get_u8();
12289 __struct.target_component = buf.get_u8();
12290 Ok(__struct)
12291 }
12292 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12293 let mut __tmp = BytesMut::new(bytes);
12294 #[allow(clippy::absurd_extreme_comparisons)]
12295 #[allow(unused_comparisons)]
12296 if __tmp.remaining() < Self::ENCODED_LEN {
12297 panic!(
12298 "buffer is too small (need {} bytes, but got {})",
12299 Self::ENCODED_LEN,
12300 __tmp.remaining(),
12301 )
12302 }
12303 __tmp.put_u16_le(self.func_index);
12304 __tmp.put_u16_le(self.result);
12305 __tmp.put_u8(self.target_system);
12306 __tmp.put_u8(self.target_component);
12307 if matches!(version, MavlinkVersion::V2) {
12308 let len = __tmp.len();
12309 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12310 } else {
12311 __tmp.len()
12312 }
12313 }
12314}
12315#[doc = "Acknowldge success or failure of a flexifunction command."]
12316#[doc = ""]
12317#[doc = "ID: 157"]
12318#[derive(Debug, Clone, PartialEq)]
12319#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12320#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12321#[cfg_attr(feature = "ts", derive(TS))]
12322#[cfg_attr(feature = "ts", ts(export))]
12323pub struct FLEXIFUNCTION_COMMAND_DATA {
12324 #[doc = "System ID"]
12325 pub target_system: u8,
12326 #[doc = "Component ID"]
12327 pub target_component: u8,
12328 #[doc = "Flexifunction command type"]
12329 pub command_type: u8,
12330}
12331impl FLEXIFUNCTION_COMMAND_DATA {
12332 pub const ENCODED_LEN: usize = 3usize;
12333 pub const DEFAULT: Self = Self {
12334 target_system: 0_u8,
12335 target_component: 0_u8,
12336 command_type: 0_u8,
12337 };
12338 #[cfg(feature = "arbitrary")]
12339 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12340 use arbitrary::{Arbitrary, Unstructured};
12341 let mut buf = [0u8; 1024];
12342 rng.fill_bytes(&mut buf);
12343 let mut unstructured = Unstructured::new(&buf);
12344 Self::arbitrary(&mut unstructured).unwrap_or_default()
12345 }
12346}
12347impl Default for FLEXIFUNCTION_COMMAND_DATA {
12348 fn default() -> Self {
12349 Self::DEFAULT.clone()
12350 }
12351}
12352impl MessageData for FLEXIFUNCTION_COMMAND_DATA {
12353 type Message = MavMessage;
12354 const ID: u32 = 157u32;
12355 const NAME: &'static str = "FLEXIFUNCTION_COMMAND";
12356 const EXTRA_CRC: u8 = 133u8;
12357 const ENCODED_LEN: usize = 3usize;
12358 fn deser(
12359 _version: MavlinkVersion,
12360 __input: &[u8],
12361 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12362 let avail_len = __input.len();
12363 let mut payload_buf = [0; Self::ENCODED_LEN];
12364 let mut buf = if avail_len < Self::ENCODED_LEN {
12365 payload_buf[0..avail_len].copy_from_slice(__input);
12366 Bytes::new(&payload_buf)
12367 } else {
12368 Bytes::new(__input)
12369 };
12370 let mut __struct = Self::default();
12371 __struct.target_system = buf.get_u8();
12372 __struct.target_component = buf.get_u8();
12373 __struct.command_type = buf.get_u8();
12374 Ok(__struct)
12375 }
12376 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12377 let mut __tmp = BytesMut::new(bytes);
12378 #[allow(clippy::absurd_extreme_comparisons)]
12379 #[allow(unused_comparisons)]
12380 if __tmp.remaining() < Self::ENCODED_LEN {
12381 panic!(
12382 "buffer is too small (need {} bytes, but got {})",
12383 Self::ENCODED_LEN,
12384 __tmp.remaining(),
12385 )
12386 }
12387 __tmp.put_u8(self.target_system);
12388 __tmp.put_u8(self.target_component);
12389 __tmp.put_u8(self.command_type);
12390 if matches!(version, MavlinkVersion::V2) {
12391 let len = __tmp.len();
12392 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12393 } else {
12394 __tmp.len()
12395 }
12396 }
12397}
12398#[doc = "Acknowldge success or failure of a flexifunction command."]
12399#[doc = ""]
12400#[doc = "ID: 158"]
12401#[derive(Debug, Clone, PartialEq)]
12402#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12403#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12404#[cfg_attr(feature = "ts", derive(TS))]
12405#[cfg_attr(feature = "ts", ts(export))]
12406pub struct FLEXIFUNCTION_COMMAND_ACK_DATA {
12407 #[doc = "Command acknowledged"]
12408 pub command_type: u16,
12409 #[doc = "result of acknowledge"]
12410 pub result: u16,
12411}
12412impl FLEXIFUNCTION_COMMAND_ACK_DATA {
12413 pub const ENCODED_LEN: usize = 4usize;
12414 pub const DEFAULT: Self = Self {
12415 command_type: 0_u16,
12416 result: 0_u16,
12417 };
12418 #[cfg(feature = "arbitrary")]
12419 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12420 use arbitrary::{Arbitrary, Unstructured};
12421 let mut buf = [0u8; 1024];
12422 rng.fill_bytes(&mut buf);
12423 let mut unstructured = Unstructured::new(&buf);
12424 Self::arbitrary(&mut unstructured).unwrap_or_default()
12425 }
12426}
12427impl Default for FLEXIFUNCTION_COMMAND_ACK_DATA {
12428 fn default() -> Self {
12429 Self::DEFAULT.clone()
12430 }
12431}
12432impl MessageData for FLEXIFUNCTION_COMMAND_ACK_DATA {
12433 type Message = MavMessage;
12434 const ID: u32 = 158u32;
12435 const NAME: &'static str = "FLEXIFUNCTION_COMMAND_ACK";
12436 const EXTRA_CRC: u8 = 208u8;
12437 const ENCODED_LEN: usize = 4usize;
12438 fn deser(
12439 _version: MavlinkVersion,
12440 __input: &[u8],
12441 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12442 let avail_len = __input.len();
12443 let mut payload_buf = [0; Self::ENCODED_LEN];
12444 let mut buf = if avail_len < Self::ENCODED_LEN {
12445 payload_buf[0..avail_len].copy_from_slice(__input);
12446 Bytes::new(&payload_buf)
12447 } else {
12448 Bytes::new(__input)
12449 };
12450 let mut __struct = Self::default();
12451 __struct.command_type = buf.get_u16_le();
12452 __struct.result = buf.get_u16_le();
12453 Ok(__struct)
12454 }
12455 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12456 let mut __tmp = BytesMut::new(bytes);
12457 #[allow(clippy::absurd_extreme_comparisons)]
12458 #[allow(unused_comparisons)]
12459 if __tmp.remaining() < Self::ENCODED_LEN {
12460 panic!(
12461 "buffer is too small (need {} bytes, but got {})",
12462 Self::ENCODED_LEN,
12463 __tmp.remaining(),
12464 )
12465 }
12466 __tmp.put_u16_le(self.command_type);
12467 __tmp.put_u16_le(self.result);
12468 if matches!(version, MavlinkVersion::V2) {
12469 let len = __tmp.len();
12470 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12471 } else {
12472 __tmp.len()
12473 }
12474 }
12475}
12476#[doc = "Acknowldge success or failure of a flexifunction command."]
12477#[doc = ""]
12478#[doc = "ID: 155"]
12479#[derive(Debug, Clone, PartialEq)]
12480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12481#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12482#[cfg_attr(feature = "ts", derive(TS))]
12483#[cfg_attr(feature = "ts", ts(export))]
12484pub struct FLEXIFUNCTION_DIRECTORY_DATA {
12485 #[doc = "System ID"]
12486 pub target_system: u8,
12487 #[doc = "Component ID"]
12488 pub target_component: u8,
12489 #[doc = "0=inputs, 1=outputs"]
12490 pub directory_type: u8,
12491 #[doc = "index of first directory entry to write"]
12492 pub start_index: u8,
12493 #[doc = "count of directory entries to write"]
12494 pub count: u8,
12495 #[doc = "Settings data"]
12496 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12497 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12498 pub directory_data: [i8; 48],
12499}
12500impl FLEXIFUNCTION_DIRECTORY_DATA {
12501 pub const ENCODED_LEN: usize = 53usize;
12502 pub const DEFAULT: Self = Self {
12503 target_system: 0_u8,
12504 target_component: 0_u8,
12505 directory_type: 0_u8,
12506 start_index: 0_u8,
12507 count: 0_u8,
12508 directory_data: [0_i8; 48usize],
12509 };
12510 #[cfg(feature = "arbitrary")]
12511 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12512 use arbitrary::{Arbitrary, Unstructured};
12513 let mut buf = [0u8; 1024];
12514 rng.fill_bytes(&mut buf);
12515 let mut unstructured = Unstructured::new(&buf);
12516 Self::arbitrary(&mut unstructured).unwrap_or_default()
12517 }
12518}
12519impl Default for FLEXIFUNCTION_DIRECTORY_DATA {
12520 fn default() -> Self {
12521 Self::DEFAULT.clone()
12522 }
12523}
12524impl MessageData for FLEXIFUNCTION_DIRECTORY_DATA {
12525 type Message = MavMessage;
12526 const ID: u32 = 155u32;
12527 const NAME: &'static str = "FLEXIFUNCTION_DIRECTORY";
12528 const EXTRA_CRC: u8 = 12u8;
12529 const ENCODED_LEN: usize = 53usize;
12530 fn deser(
12531 _version: MavlinkVersion,
12532 __input: &[u8],
12533 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12534 let avail_len = __input.len();
12535 let mut payload_buf = [0; Self::ENCODED_LEN];
12536 let mut buf = if avail_len < Self::ENCODED_LEN {
12537 payload_buf[0..avail_len].copy_from_slice(__input);
12538 Bytes::new(&payload_buf)
12539 } else {
12540 Bytes::new(__input)
12541 };
12542 let mut __struct = Self::default();
12543 __struct.target_system = buf.get_u8();
12544 __struct.target_component = buf.get_u8();
12545 __struct.directory_type = buf.get_u8();
12546 __struct.start_index = buf.get_u8();
12547 __struct.count = buf.get_u8();
12548 for v in &mut __struct.directory_data {
12549 let val = buf.get_i8();
12550 *v = val;
12551 }
12552 Ok(__struct)
12553 }
12554 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12555 let mut __tmp = BytesMut::new(bytes);
12556 #[allow(clippy::absurd_extreme_comparisons)]
12557 #[allow(unused_comparisons)]
12558 if __tmp.remaining() < Self::ENCODED_LEN {
12559 panic!(
12560 "buffer is too small (need {} bytes, but got {})",
12561 Self::ENCODED_LEN,
12562 __tmp.remaining(),
12563 )
12564 }
12565 __tmp.put_u8(self.target_system);
12566 __tmp.put_u8(self.target_component);
12567 __tmp.put_u8(self.directory_type);
12568 __tmp.put_u8(self.start_index);
12569 __tmp.put_u8(self.count);
12570 for val in &self.directory_data {
12571 __tmp.put_i8(*val);
12572 }
12573 if matches!(version, MavlinkVersion::V2) {
12574 let len = __tmp.len();
12575 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12576 } else {
12577 __tmp.len()
12578 }
12579 }
12580}
12581#[doc = "Acknowldge success or failure of a flexifunction command."]
12582#[doc = ""]
12583#[doc = "ID: 156"]
12584#[derive(Debug, Clone, PartialEq)]
12585#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12586#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12587#[cfg_attr(feature = "ts", derive(TS))]
12588#[cfg_attr(feature = "ts", ts(export))]
12589pub struct FLEXIFUNCTION_DIRECTORY_ACK_DATA {
12590 #[doc = "result of acknowledge, 0=fail, 1=good"]
12591 pub result: u16,
12592 #[doc = "System ID"]
12593 pub target_system: u8,
12594 #[doc = "Component ID"]
12595 pub target_component: u8,
12596 #[doc = "0=inputs, 1=outputs"]
12597 pub directory_type: u8,
12598 #[doc = "index of first directory entry to write"]
12599 pub start_index: u8,
12600 #[doc = "count of directory entries to write"]
12601 pub count: u8,
12602}
12603impl FLEXIFUNCTION_DIRECTORY_ACK_DATA {
12604 pub const ENCODED_LEN: usize = 7usize;
12605 pub const DEFAULT: Self = Self {
12606 result: 0_u16,
12607 target_system: 0_u8,
12608 target_component: 0_u8,
12609 directory_type: 0_u8,
12610 start_index: 0_u8,
12611 count: 0_u8,
12612 };
12613 #[cfg(feature = "arbitrary")]
12614 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12615 use arbitrary::{Arbitrary, Unstructured};
12616 let mut buf = [0u8; 1024];
12617 rng.fill_bytes(&mut buf);
12618 let mut unstructured = Unstructured::new(&buf);
12619 Self::arbitrary(&mut unstructured).unwrap_or_default()
12620 }
12621}
12622impl Default for FLEXIFUNCTION_DIRECTORY_ACK_DATA {
12623 fn default() -> Self {
12624 Self::DEFAULT.clone()
12625 }
12626}
12627impl MessageData for FLEXIFUNCTION_DIRECTORY_ACK_DATA {
12628 type Message = MavMessage;
12629 const ID: u32 = 156u32;
12630 const NAME: &'static str = "FLEXIFUNCTION_DIRECTORY_ACK";
12631 const EXTRA_CRC: u8 = 218u8;
12632 const ENCODED_LEN: usize = 7usize;
12633 fn deser(
12634 _version: MavlinkVersion,
12635 __input: &[u8],
12636 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12637 let avail_len = __input.len();
12638 let mut payload_buf = [0; Self::ENCODED_LEN];
12639 let mut buf = if avail_len < Self::ENCODED_LEN {
12640 payload_buf[0..avail_len].copy_from_slice(__input);
12641 Bytes::new(&payload_buf)
12642 } else {
12643 Bytes::new(__input)
12644 };
12645 let mut __struct = Self::default();
12646 __struct.result = buf.get_u16_le();
12647 __struct.target_system = buf.get_u8();
12648 __struct.target_component = buf.get_u8();
12649 __struct.directory_type = buf.get_u8();
12650 __struct.start_index = buf.get_u8();
12651 __struct.count = buf.get_u8();
12652 Ok(__struct)
12653 }
12654 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12655 let mut __tmp = BytesMut::new(bytes);
12656 #[allow(clippy::absurd_extreme_comparisons)]
12657 #[allow(unused_comparisons)]
12658 if __tmp.remaining() < Self::ENCODED_LEN {
12659 panic!(
12660 "buffer is too small (need {} bytes, but got {})",
12661 Self::ENCODED_LEN,
12662 __tmp.remaining(),
12663 )
12664 }
12665 __tmp.put_u16_le(self.result);
12666 __tmp.put_u8(self.target_system);
12667 __tmp.put_u8(self.target_component);
12668 __tmp.put_u8(self.directory_type);
12669 __tmp.put_u8(self.start_index);
12670 __tmp.put_u8(self.count);
12671 if matches!(version, MavlinkVersion::V2) {
12672 let len = __tmp.len();
12673 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12674 } else {
12675 __tmp.len()
12676 }
12677 }
12678}
12679#[doc = "Request reading of flexifunction data."]
12680#[doc = ""]
12681#[doc = "ID: 151"]
12682#[derive(Debug, Clone, PartialEq)]
12683#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12684#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12685#[cfg_attr(feature = "ts", derive(TS))]
12686#[cfg_attr(feature = "ts", ts(export))]
12687pub struct FLEXIFUNCTION_READ_REQ_DATA {
12688 #[doc = "Type of flexifunction data requested"]
12689 pub read_req_type: i16,
12690 #[doc = "index into data where needed"]
12691 pub data_index: i16,
12692 #[doc = "System ID"]
12693 pub target_system: u8,
12694 #[doc = "Component ID"]
12695 pub target_component: u8,
12696}
12697impl FLEXIFUNCTION_READ_REQ_DATA {
12698 pub const ENCODED_LEN: usize = 6usize;
12699 pub const DEFAULT: Self = Self {
12700 read_req_type: 0_i16,
12701 data_index: 0_i16,
12702 target_system: 0_u8,
12703 target_component: 0_u8,
12704 };
12705 #[cfg(feature = "arbitrary")]
12706 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12707 use arbitrary::{Arbitrary, Unstructured};
12708 let mut buf = [0u8; 1024];
12709 rng.fill_bytes(&mut buf);
12710 let mut unstructured = Unstructured::new(&buf);
12711 Self::arbitrary(&mut unstructured).unwrap_or_default()
12712 }
12713}
12714impl Default for FLEXIFUNCTION_READ_REQ_DATA {
12715 fn default() -> Self {
12716 Self::DEFAULT.clone()
12717 }
12718}
12719impl MessageData for FLEXIFUNCTION_READ_REQ_DATA {
12720 type Message = MavMessage;
12721 const ID: u32 = 151u32;
12722 const NAME: &'static str = "FLEXIFUNCTION_READ_REQ";
12723 const EXTRA_CRC: u8 = 26u8;
12724 const ENCODED_LEN: usize = 6usize;
12725 fn deser(
12726 _version: MavlinkVersion,
12727 __input: &[u8],
12728 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12729 let avail_len = __input.len();
12730 let mut payload_buf = [0; Self::ENCODED_LEN];
12731 let mut buf = if avail_len < Self::ENCODED_LEN {
12732 payload_buf[0..avail_len].copy_from_slice(__input);
12733 Bytes::new(&payload_buf)
12734 } else {
12735 Bytes::new(__input)
12736 };
12737 let mut __struct = Self::default();
12738 __struct.read_req_type = buf.get_i16_le();
12739 __struct.data_index = buf.get_i16_le();
12740 __struct.target_system = buf.get_u8();
12741 __struct.target_component = buf.get_u8();
12742 Ok(__struct)
12743 }
12744 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12745 let mut __tmp = BytesMut::new(bytes);
12746 #[allow(clippy::absurd_extreme_comparisons)]
12747 #[allow(unused_comparisons)]
12748 if __tmp.remaining() < Self::ENCODED_LEN {
12749 panic!(
12750 "buffer is too small (need {} bytes, but got {})",
12751 Self::ENCODED_LEN,
12752 __tmp.remaining(),
12753 )
12754 }
12755 __tmp.put_i16_le(self.read_req_type);
12756 __tmp.put_i16_le(self.data_index);
12757 __tmp.put_u8(self.target_system);
12758 __tmp.put_u8(self.target_component);
12759 if matches!(version, MavlinkVersion::V2) {
12760 let len = __tmp.len();
12761 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12762 } else {
12763 __tmp.len()
12764 }
12765 }
12766}
12767#[doc = "Depreciated but used as a compiler flag. Do not remove."]
12768#[doc = ""]
12769#[doc = "ID: 150"]
12770#[derive(Debug, Clone, PartialEq)]
12771#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12772#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12773#[cfg_attr(feature = "ts", derive(TS))]
12774#[cfg_attr(feature = "ts", ts(export))]
12775pub struct FLEXIFUNCTION_SET_DATA {
12776 #[doc = "System ID"]
12777 pub target_system: u8,
12778 #[doc = "Component ID"]
12779 pub target_component: u8,
12780}
12781impl FLEXIFUNCTION_SET_DATA {
12782 pub const ENCODED_LEN: usize = 2usize;
12783 pub const DEFAULT: Self = Self {
12784 target_system: 0_u8,
12785 target_component: 0_u8,
12786 };
12787 #[cfg(feature = "arbitrary")]
12788 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12789 use arbitrary::{Arbitrary, Unstructured};
12790 let mut buf = [0u8; 1024];
12791 rng.fill_bytes(&mut buf);
12792 let mut unstructured = Unstructured::new(&buf);
12793 Self::arbitrary(&mut unstructured).unwrap_or_default()
12794 }
12795}
12796impl Default for FLEXIFUNCTION_SET_DATA {
12797 fn default() -> Self {
12798 Self::DEFAULT.clone()
12799 }
12800}
12801impl MessageData for FLEXIFUNCTION_SET_DATA {
12802 type Message = MavMessage;
12803 const ID: u32 = 150u32;
12804 const NAME: &'static str = "FLEXIFUNCTION_SET";
12805 const EXTRA_CRC: u8 = 181u8;
12806 const ENCODED_LEN: usize = 2usize;
12807 fn deser(
12808 _version: MavlinkVersion,
12809 __input: &[u8],
12810 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12811 let avail_len = __input.len();
12812 let mut payload_buf = [0; Self::ENCODED_LEN];
12813 let mut buf = if avail_len < Self::ENCODED_LEN {
12814 payload_buf[0..avail_len].copy_from_slice(__input);
12815 Bytes::new(&payload_buf)
12816 } else {
12817 Bytes::new(__input)
12818 };
12819 let mut __struct = Self::default();
12820 __struct.target_system = buf.get_u8();
12821 __struct.target_component = buf.get_u8();
12822 Ok(__struct)
12823 }
12824 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12825 let mut __tmp = BytesMut::new(bytes);
12826 #[allow(clippy::absurd_extreme_comparisons)]
12827 #[allow(unused_comparisons)]
12828 if __tmp.remaining() < Self::ENCODED_LEN {
12829 panic!(
12830 "buffer is too small (need {} bytes, but got {})",
12831 Self::ENCODED_LEN,
12832 __tmp.remaining(),
12833 )
12834 }
12835 __tmp.put_u8(self.target_system);
12836 __tmp.put_u8(self.target_component);
12837 if matches!(version, MavlinkVersion::V2) {
12838 let len = __tmp.len();
12839 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12840 } else {
12841 __tmp.len()
12842 }
12843 }
12844}
12845#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
12846#[doc = ""]
12847#[doc = "ID: 264"]
12848#[derive(Debug, Clone, PartialEq)]
12849#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12850#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12851#[cfg_attr(feature = "ts", derive(TS))]
12852#[cfg_attr(feature = "ts", ts(export))]
12853pub struct FLIGHT_INFORMATION_DATA {
12854 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
12855 pub arming_time_utc: u64,
12856 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
12857 pub takeoff_time_utc: u64,
12858 #[doc = "Flight number. Note, field is misnamed UUID."]
12859 pub flight_uuid: u64,
12860 #[doc = "Timestamp (time since system boot)."]
12861 pub time_boot_ms: u32,
12862 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
12863 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12864 pub landing_time: u32,
12865}
12866impl FLIGHT_INFORMATION_DATA {
12867 pub const ENCODED_LEN: usize = 32usize;
12868 pub const DEFAULT: Self = Self {
12869 arming_time_utc: 0_u64,
12870 takeoff_time_utc: 0_u64,
12871 flight_uuid: 0_u64,
12872 time_boot_ms: 0_u32,
12873 landing_time: 0_u32,
12874 };
12875 #[cfg(feature = "arbitrary")]
12876 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12877 use arbitrary::{Arbitrary, Unstructured};
12878 let mut buf = [0u8; 1024];
12879 rng.fill_bytes(&mut buf);
12880 let mut unstructured = Unstructured::new(&buf);
12881 Self::arbitrary(&mut unstructured).unwrap_or_default()
12882 }
12883}
12884impl Default for FLIGHT_INFORMATION_DATA {
12885 fn default() -> Self {
12886 Self::DEFAULT.clone()
12887 }
12888}
12889impl MessageData for FLIGHT_INFORMATION_DATA {
12890 type Message = MavMessage;
12891 const ID: u32 = 264u32;
12892 const NAME: &'static str = "FLIGHT_INFORMATION";
12893 const EXTRA_CRC: u8 = 49u8;
12894 const ENCODED_LEN: usize = 32usize;
12895 fn deser(
12896 _version: MavlinkVersion,
12897 __input: &[u8],
12898 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12899 let avail_len = __input.len();
12900 let mut payload_buf = [0; Self::ENCODED_LEN];
12901 let mut buf = if avail_len < Self::ENCODED_LEN {
12902 payload_buf[0..avail_len].copy_from_slice(__input);
12903 Bytes::new(&payload_buf)
12904 } else {
12905 Bytes::new(__input)
12906 };
12907 let mut __struct = Self::default();
12908 __struct.arming_time_utc = buf.get_u64_le();
12909 __struct.takeoff_time_utc = buf.get_u64_le();
12910 __struct.flight_uuid = buf.get_u64_le();
12911 __struct.time_boot_ms = buf.get_u32_le();
12912 __struct.landing_time = buf.get_u32_le();
12913 Ok(__struct)
12914 }
12915 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12916 let mut __tmp = BytesMut::new(bytes);
12917 #[allow(clippy::absurd_extreme_comparisons)]
12918 #[allow(unused_comparisons)]
12919 if __tmp.remaining() < Self::ENCODED_LEN {
12920 panic!(
12921 "buffer is too small (need {} bytes, but got {})",
12922 Self::ENCODED_LEN,
12923 __tmp.remaining(),
12924 )
12925 }
12926 __tmp.put_u64_le(self.arming_time_utc);
12927 __tmp.put_u64_le(self.takeoff_time_utc);
12928 __tmp.put_u64_le(self.flight_uuid);
12929 __tmp.put_u32_le(self.time_boot_ms);
12930 if matches!(version, MavlinkVersion::V2) {
12931 __tmp.put_u32_le(self.landing_time);
12932 let len = __tmp.len();
12933 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12934 } else {
12935 __tmp.len()
12936 }
12937 }
12938}
12939#[doc = "Current motion information from a designated system."]
12940#[doc = ""]
12941#[doc = "ID: 144"]
12942#[derive(Debug, Clone, PartialEq)]
12943#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12944#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12945#[cfg_attr(feature = "ts", derive(TS))]
12946#[cfg_attr(feature = "ts", ts(export))]
12947pub struct FOLLOW_TARGET_DATA {
12948 #[doc = "Timestamp (time since system boot)."]
12949 pub timestamp: u64,
12950 #[doc = "button states or switches of a tracker device"]
12951 pub custom_state: u64,
12952 #[doc = "Latitude (WGS84)"]
12953 pub lat: i32,
12954 #[doc = "Longitude (WGS84)"]
12955 pub lon: i32,
12956 #[doc = "Altitude (MSL)"]
12957 pub alt: f32,
12958 #[doc = "target velocity (0,0,0) for unknown"]
12959 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12960 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12961 pub vel: [f32; 3],
12962 #[doc = "linear target acceleration (0,0,0) for unknown"]
12963 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12964 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12965 pub acc: [f32; 3],
12966 #[doc = "(0 0 0 0 for unknown)"]
12967 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12968 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12969 pub attitude_q: [f32; 4],
12970 #[doc = "(0 0 0 for unknown)"]
12971 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12972 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12973 pub rates: [f32; 3],
12974 #[doc = "eph epv"]
12975 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12976 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12977 pub position_cov: [f32; 3],
12978 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
12979 pub est_capabilities: u8,
12980}
12981impl FOLLOW_TARGET_DATA {
12982 pub const ENCODED_LEN: usize = 93usize;
12983 pub const DEFAULT: Self = Self {
12984 timestamp: 0_u64,
12985 custom_state: 0_u64,
12986 lat: 0_i32,
12987 lon: 0_i32,
12988 alt: 0.0_f32,
12989 vel: [0.0_f32; 3usize],
12990 acc: [0.0_f32; 3usize],
12991 attitude_q: [0.0_f32; 4usize],
12992 rates: [0.0_f32; 3usize],
12993 position_cov: [0.0_f32; 3usize],
12994 est_capabilities: 0_u8,
12995 };
12996 #[cfg(feature = "arbitrary")]
12997 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12998 use arbitrary::{Arbitrary, Unstructured};
12999 let mut buf = [0u8; 1024];
13000 rng.fill_bytes(&mut buf);
13001 let mut unstructured = Unstructured::new(&buf);
13002 Self::arbitrary(&mut unstructured).unwrap_or_default()
13003 }
13004}
13005impl Default for FOLLOW_TARGET_DATA {
13006 fn default() -> Self {
13007 Self::DEFAULT.clone()
13008 }
13009}
13010impl MessageData for FOLLOW_TARGET_DATA {
13011 type Message = MavMessage;
13012 const ID: u32 = 144u32;
13013 const NAME: &'static str = "FOLLOW_TARGET";
13014 const EXTRA_CRC: u8 = 127u8;
13015 const ENCODED_LEN: usize = 93usize;
13016 fn deser(
13017 _version: MavlinkVersion,
13018 __input: &[u8],
13019 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13020 let avail_len = __input.len();
13021 let mut payload_buf = [0; Self::ENCODED_LEN];
13022 let mut buf = if avail_len < Self::ENCODED_LEN {
13023 payload_buf[0..avail_len].copy_from_slice(__input);
13024 Bytes::new(&payload_buf)
13025 } else {
13026 Bytes::new(__input)
13027 };
13028 let mut __struct = Self::default();
13029 __struct.timestamp = buf.get_u64_le();
13030 __struct.custom_state = buf.get_u64_le();
13031 __struct.lat = buf.get_i32_le();
13032 __struct.lon = buf.get_i32_le();
13033 __struct.alt = buf.get_f32_le();
13034 for v in &mut __struct.vel {
13035 let val = buf.get_f32_le();
13036 *v = val;
13037 }
13038 for v in &mut __struct.acc {
13039 let val = buf.get_f32_le();
13040 *v = val;
13041 }
13042 for v in &mut __struct.attitude_q {
13043 let val = buf.get_f32_le();
13044 *v = val;
13045 }
13046 for v in &mut __struct.rates {
13047 let val = buf.get_f32_le();
13048 *v = val;
13049 }
13050 for v in &mut __struct.position_cov {
13051 let val = buf.get_f32_le();
13052 *v = val;
13053 }
13054 __struct.est_capabilities = buf.get_u8();
13055 Ok(__struct)
13056 }
13057 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13058 let mut __tmp = BytesMut::new(bytes);
13059 #[allow(clippy::absurd_extreme_comparisons)]
13060 #[allow(unused_comparisons)]
13061 if __tmp.remaining() < Self::ENCODED_LEN {
13062 panic!(
13063 "buffer is too small (need {} bytes, but got {})",
13064 Self::ENCODED_LEN,
13065 __tmp.remaining(),
13066 )
13067 }
13068 __tmp.put_u64_le(self.timestamp);
13069 __tmp.put_u64_le(self.custom_state);
13070 __tmp.put_i32_le(self.lat);
13071 __tmp.put_i32_le(self.lon);
13072 __tmp.put_f32_le(self.alt);
13073 for val in &self.vel {
13074 __tmp.put_f32_le(*val);
13075 }
13076 for val in &self.acc {
13077 __tmp.put_f32_le(*val);
13078 }
13079 for val in &self.attitude_q {
13080 __tmp.put_f32_le(*val);
13081 }
13082 for val in &self.rates {
13083 __tmp.put_f32_le(*val);
13084 }
13085 for val in &self.position_cov {
13086 __tmp.put_f32_le(*val);
13087 }
13088 __tmp.put_u8(self.est_capabilities);
13089 if matches!(version, MavlinkVersion::V2) {
13090 let len = __tmp.len();
13091 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13092 } else {
13093 __tmp.len()
13094 }
13095 }
13096}
13097#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
13098#[doc = ""]
13099#[doc = "ID: 371"]
13100#[derive(Debug, Clone, PartialEq)]
13101#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13102#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13103#[cfg_attr(feature = "ts", derive(TS))]
13104#[cfg_attr(feature = "ts", ts(export))]
13105pub struct FUEL_STATUS_DATA {
13106 #[doc = "Capacity when full. Must be provided."]
13107 pub maximum_fuel: f32,
13108 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
13109 pub consumed_fuel: f32,
13110 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
13111 pub remaining_fuel: f32,
13112 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
13113 pub flow_rate: f32,
13114 #[doc = "Fuel temperature. NaN: field not provided."]
13115 pub temperature: f32,
13116 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
13117 pub fuel_type: MavFuelType,
13118 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
13119 pub id: u8,
13120 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
13121 pub percent_remaining: u8,
13122}
13123impl FUEL_STATUS_DATA {
13124 pub const ENCODED_LEN: usize = 26usize;
13125 pub const DEFAULT: Self = Self {
13126 maximum_fuel: 0.0_f32,
13127 consumed_fuel: 0.0_f32,
13128 remaining_fuel: 0.0_f32,
13129 flow_rate: 0.0_f32,
13130 temperature: 0.0_f32,
13131 fuel_type: MavFuelType::DEFAULT,
13132 id: 0_u8,
13133 percent_remaining: 0_u8,
13134 };
13135 #[cfg(feature = "arbitrary")]
13136 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13137 use arbitrary::{Arbitrary, Unstructured};
13138 let mut buf = [0u8; 1024];
13139 rng.fill_bytes(&mut buf);
13140 let mut unstructured = Unstructured::new(&buf);
13141 Self::arbitrary(&mut unstructured).unwrap_or_default()
13142 }
13143}
13144impl Default for FUEL_STATUS_DATA {
13145 fn default() -> Self {
13146 Self::DEFAULT.clone()
13147 }
13148}
13149impl MessageData for FUEL_STATUS_DATA {
13150 type Message = MavMessage;
13151 const ID: u32 = 371u32;
13152 const NAME: &'static str = "FUEL_STATUS";
13153 const EXTRA_CRC: u8 = 10u8;
13154 const ENCODED_LEN: usize = 26usize;
13155 fn deser(
13156 _version: MavlinkVersion,
13157 __input: &[u8],
13158 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13159 let avail_len = __input.len();
13160 let mut payload_buf = [0; Self::ENCODED_LEN];
13161 let mut buf = if avail_len < Self::ENCODED_LEN {
13162 payload_buf[0..avail_len].copy_from_slice(__input);
13163 Bytes::new(&payload_buf)
13164 } else {
13165 Bytes::new(__input)
13166 };
13167 let mut __struct = Self::default();
13168 __struct.maximum_fuel = buf.get_f32_le();
13169 __struct.consumed_fuel = buf.get_f32_le();
13170 __struct.remaining_fuel = buf.get_f32_le();
13171 __struct.flow_rate = buf.get_f32_le();
13172 __struct.temperature = buf.get_f32_le();
13173 let tmp = buf.get_u32_le();
13174 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
13175 ::mavlink_core::error::ParserError::InvalidEnum {
13176 enum_type: "MavFuelType",
13177 value: tmp as u32,
13178 },
13179 )?;
13180 __struct.id = buf.get_u8();
13181 __struct.percent_remaining = buf.get_u8();
13182 Ok(__struct)
13183 }
13184 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13185 let mut __tmp = BytesMut::new(bytes);
13186 #[allow(clippy::absurd_extreme_comparisons)]
13187 #[allow(unused_comparisons)]
13188 if __tmp.remaining() < Self::ENCODED_LEN {
13189 panic!(
13190 "buffer is too small (need {} bytes, but got {})",
13191 Self::ENCODED_LEN,
13192 __tmp.remaining(),
13193 )
13194 }
13195 __tmp.put_f32_le(self.maximum_fuel);
13196 __tmp.put_f32_le(self.consumed_fuel);
13197 __tmp.put_f32_le(self.remaining_fuel);
13198 __tmp.put_f32_le(self.flow_rate);
13199 __tmp.put_f32_le(self.temperature);
13200 __tmp.put_u32_le(self.fuel_type as u32);
13201 __tmp.put_u8(self.id);
13202 __tmp.put_u8(self.percent_remaining);
13203 if matches!(version, MavlinkVersion::V2) {
13204 let len = __tmp.len();
13205 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13206 } else {
13207 __tmp.len()
13208 }
13209 }
13210}
13211#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
13212#[doc = ""]
13213#[doc = "ID: 373"]
13214#[derive(Debug, Clone, PartialEq)]
13215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13216#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13217#[cfg_attr(feature = "ts", derive(TS))]
13218#[cfg_attr(feature = "ts", ts(export))]
13219pub struct GENERATOR_STATUS_DATA {
13220 #[doc = "Status flags."]
13221 pub status: MavGeneratorStatusFlag,
13222 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
13223 pub battery_current: f32,
13224 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
13225 pub load_current: f32,
13226 #[doc = "The power being generated. NaN: field not provided"]
13227 pub power_generated: f32,
13228 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
13229 pub bus_voltage: f32,
13230 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
13231 pub bat_current_setpoint: f32,
13232 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
13233 pub runtime: u32,
13234 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
13235 pub time_until_maintenance: i32,
13236 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
13237 pub generator_speed: u16,
13238 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
13239 pub rectifier_temperature: i16,
13240 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
13241 pub generator_temperature: i16,
13242}
13243impl GENERATOR_STATUS_DATA {
13244 pub const ENCODED_LEN: usize = 42usize;
13245 pub const DEFAULT: Self = Self {
13246 status: MavGeneratorStatusFlag::DEFAULT,
13247 battery_current: 0.0_f32,
13248 load_current: 0.0_f32,
13249 power_generated: 0.0_f32,
13250 bus_voltage: 0.0_f32,
13251 bat_current_setpoint: 0.0_f32,
13252 runtime: 0_u32,
13253 time_until_maintenance: 0_i32,
13254 generator_speed: 0_u16,
13255 rectifier_temperature: 0_i16,
13256 generator_temperature: 0_i16,
13257 };
13258 #[cfg(feature = "arbitrary")]
13259 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13260 use arbitrary::{Arbitrary, Unstructured};
13261 let mut buf = [0u8; 1024];
13262 rng.fill_bytes(&mut buf);
13263 let mut unstructured = Unstructured::new(&buf);
13264 Self::arbitrary(&mut unstructured).unwrap_or_default()
13265 }
13266}
13267impl Default for GENERATOR_STATUS_DATA {
13268 fn default() -> Self {
13269 Self::DEFAULT.clone()
13270 }
13271}
13272impl MessageData for GENERATOR_STATUS_DATA {
13273 type Message = MavMessage;
13274 const ID: u32 = 373u32;
13275 const NAME: &'static str = "GENERATOR_STATUS";
13276 const EXTRA_CRC: u8 = 117u8;
13277 const ENCODED_LEN: usize = 42usize;
13278 fn deser(
13279 _version: MavlinkVersion,
13280 __input: &[u8],
13281 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13282 let avail_len = __input.len();
13283 let mut payload_buf = [0; Self::ENCODED_LEN];
13284 let mut buf = if avail_len < Self::ENCODED_LEN {
13285 payload_buf[0..avail_len].copy_from_slice(__input);
13286 Bytes::new(&payload_buf)
13287 } else {
13288 Bytes::new(__input)
13289 };
13290 let mut __struct = Self::default();
13291 let tmp = buf.get_u64_le();
13292 __struct.status = MavGeneratorStatusFlag::from_bits(
13293 tmp & MavGeneratorStatusFlag::all().bits(),
13294 )
13295 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13296 flag_type: "MavGeneratorStatusFlag",
13297 value: tmp as u32,
13298 })?;
13299 __struct.battery_current = buf.get_f32_le();
13300 __struct.load_current = buf.get_f32_le();
13301 __struct.power_generated = buf.get_f32_le();
13302 __struct.bus_voltage = buf.get_f32_le();
13303 __struct.bat_current_setpoint = buf.get_f32_le();
13304 __struct.runtime = buf.get_u32_le();
13305 __struct.time_until_maintenance = buf.get_i32_le();
13306 __struct.generator_speed = buf.get_u16_le();
13307 __struct.rectifier_temperature = buf.get_i16_le();
13308 __struct.generator_temperature = buf.get_i16_le();
13309 Ok(__struct)
13310 }
13311 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13312 let mut __tmp = BytesMut::new(bytes);
13313 #[allow(clippy::absurd_extreme_comparisons)]
13314 #[allow(unused_comparisons)]
13315 if __tmp.remaining() < Self::ENCODED_LEN {
13316 panic!(
13317 "buffer is too small (need {} bytes, but got {})",
13318 Self::ENCODED_LEN,
13319 __tmp.remaining(),
13320 )
13321 }
13322 __tmp.put_u64_le(self.status.bits());
13323 __tmp.put_f32_le(self.battery_current);
13324 __tmp.put_f32_le(self.load_current);
13325 __tmp.put_f32_le(self.power_generated);
13326 __tmp.put_f32_le(self.bus_voltage);
13327 __tmp.put_f32_le(self.bat_current_setpoint);
13328 __tmp.put_u32_le(self.runtime);
13329 __tmp.put_i32_le(self.time_until_maintenance);
13330 __tmp.put_u16_le(self.generator_speed);
13331 __tmp.put_i16_le(self.rectifier_temperature);
13332 __tmp.put_i16_le(self.generator_temperature);
13333 if matches!(version, MavlinkVersion::V2) {
13334 let len = __tmp.len();
13335 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13336 } else {
13337 __tmp.len()
13338 }
13339 }
13340}
13341#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
13342#[doc = ""]
13343#[doc = "ID: 285"]
13344#[derive(Debug, Clone, PartialEq)]
13345#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13346#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13347#[cfg_attr(feature = "ts", derive(TS))]
13348#[cfg_attr(feature = "ts", ts(export))]
13349pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
13350 #[doc = "Timestamp (time since system boot)."]
13351 pub time_boot_ms: u32,
13352 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
13353 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13354 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13355 pub q: [f32; 4],
13356 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
13357 pub angular_velocity_x: f32,
13358 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
13359 pub angular_velocity_y: f32,
13360 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
13361 pub angular_velocity_z: f32,
13362 #[doc = "Failure flags (0 for no failure)"]
13363 pub failure_flags: GimbalDeviceErrorFlags,
13364 #[doc = "Current gimbal flags set."]
13365 pub flags: GimbalDeviceFlags,
13366 #[doc = "System ID"]
13367 pub target_system: u8,
13368 #[doc = "Component ID"]
13369 pub target_component: u8,
13370 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
13371 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13372 pub delta_yaw: f32,
13373 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
13374 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13375 pub delta_yaw_velocity: f32,
13376 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
13377 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13378 pub gimbal_device_id: u8,
13379}
13380impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
13381 pub const ENCODED_LEN: usize = 49usize;
13382 pub const DEFAULT: Self = Self {
13383 time_boot_ms: 0_u32,
13384 q: [0.0_f32; 4usize],
13385 angular_velocity_x: 0.0_f32,
13386 angular_velocity_y: 0.0_f32,
13387 angular_velocity_z: 0.0_f32,
13388 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
13389 flags: GimbalDeviceFlags::DEFAULT,
13390 target_system: 0_u8,
13391 target_component: 0_u8,
13392 delta_yaw: 0.0_f32,
13393 delta_yaw_velocity: 0.0_f32,
13394 gimbal_device_id: 0_u8,
13395 };
13396 #[cfg(feature = "arbitrary")]
13397 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13398 use arbitrary::{Arbitrary, Unstructured};
13399 let mut buf = [0u8; 1024];
13400 rng.fill_bytes(&mut buf);
13401 let mut unstructured = Unstructured::new(&buf);
13402 Self::arbitrary(&mut unstructured).unwrap_or_default()
13403 }
13404}
13405impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
13406 fn default() -> Self {
13407 Self::DEFAULT.clone()
13408 }
13409}
13410impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
13411 type Message = MavMessage;
13412 const ID: u32 = 285u32;
13413 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
13414 const EXTRA_CRC: u8 = 137u8;
13415 const ENCODED_LEN: usize = 49usize;
13416 fn deser(
13417 _version: MavlinkVersion,
13418 __input: &[u8],
13419 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13420 let avail_len = __input.len();
13421 let mut payload_buf = [0; Self::ENCODED_LEN];
13422 let mut buf = if avail_len < Self::ENCODED_LEN {
13423 payload_buf[0..avail_len].copy_from_slice(__input);
13424 Bytes::new(&payload_buf)
13425 } else {
13426 Bytes::new(__input)
13427 };
13428 let mut __struct = Self::default();
13429 __struct.time_boot_ms = buf.get_u32_le();
13430 for v in &mut __struct.q {
13431 let val = buf.get_f32_le();
13432 *v = val;
13433 }
13434 __struct.angular_velocity_x = buf.get_f32_le();
13435 __struct.angular_velocity_y = buf.get_f32_le();
13436 __struct.angular_velocity_z = buf.get_f32_le();
13437 let tmp = buf.get_u32_le();
13438 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
13439 tmp & GimbalDeviceErrorFlags::all().bits(),
13440 )
13441 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13442 flag_type: "GimbalDeviceErrorFlags",
13443 value: tmp as u32,
13444 })?;
13445 let tmp = buf.get_u16_le();
13446 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
13447 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13448 flag_type: "GimbalDeviceFlags",
13449 value: tmp as u32,
13450 })?;
13451 __struct.target_system = buf.get_u8();
13452 __struct.target_component = buf.get_u8();
13453 __struct.delta_yaw = buf.get_f32_le();
13454 __struct.delta_yaw_velocity = buf.get_f32_le();
13455 __struct.gimbal_device_id = buf.get_u8();
13456 Ok(__struct)
13457 }
13458 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13459 let mut __tmp = BytesMut::new(bytes);
13460 #[allow(clippy::absurd_extreme_comparisons)]
13461 #[allow(unused_comparisons)]
13462 if __tmp.remaining() < Self::ENCODED_LEN {
13463 panic!(
13464 "buffer is too small (need {} bytes, but got {})",
13465 Self::ENCODED_LEN,
13466 __tmp.remaining(),
13467 )
13468 }
13469 __tmp.put_u32_le(self.time_boot_ms);
13470 for val in &self.q {
13471 __tmp.put_f32_le(*val);
13472 }
13473 __tmp.put_f32_le(self.angular_velocity_x);
13474 __tmp.put_f32_le(self.angular_velocity_y);
13475 __tmp.put_f32_le(self.angular_velocity_z);
13476 __tmp.put_u32_le(self.failure_flags.bits());
13477 __tmp.put_u16_le(self.flags.bits());
13478 __tmp.put_u8(self.target_system);
13479 __tmp.put_u8(self.target_component);
13480 if matches!(version, MavlinkVersion::V2) {
13481 __tmp.put_f32_le(self.delta_yaw);
13482 __tmp.put_f32_le(self.delta_yaw_velocity);
13483 __tmp.put_u8(self.gimbal_device_id);
13484 let len = __tmp.len();
13485 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13486 } else {
13487 __tmp.len()
13488 }
13489 }
13490}
13491#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
13492#[doc = ""]
13493#[doc = "ID: 283"]
13494#[derive(Debug, Clone, PartialEq)]
13495#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13496#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13497#[cfg_attr(feature = "ts", derive(TS))]
13498#[cfg_attr(feature = "ts", ts(export))]
13499pub struct GIMBAL_DEVICE_INFORMATION_DATA {
13500 #[doc = "UID of gimbal hardware (0 if unknown)."]
13501 pub uid: u64,
13502 #[doc = "Timestamp (time since system boot)."]
13503 pub time_boot_ms: u32,
13504 #[doc = "0xff)."]
13505 pub firmware_version: u32,
13506 #[doc = "0xff)."]
13507 pub hardware_version: u32,
13508 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
13509 pub roll_min: f32,
13510 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
13511 pub roll_max: f32,
13512 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
13513 pub pitch_min: f32,
13514 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
13515 pub pitch_max: f32,
13516 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
13517 pub yaw_min: f32,
13518 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
13519 pub yaw_max: f32,
13520 #[doc = "Bitmap of gimbal capability flags."]
13521 pub cap_flags: GimbalDeviceCapFlags,
13522 #[doc = "Bitmap for use for gimbal-specific capability flags."]
13523 pub custom_cap_flags: u16,
13524 #[doc = "Name of the gimbal vendor."]
13525 #[cfg_attr(
13526 feature = "serde",
13527 serde(
13528 serialize_with = "crate::nulstr::serialize::<_, 32>",
13529 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
13530 )
13531 )]
13532 #[cfg_attr(feature = "ts", ts(type = "string"))]
13533 pub vendor_name: [u8; 32],
13534 #[doc = "Name of the gimbal model."]
13535 #[cfg_attr(
13536 feature = "serde",
13537 serde(
13538 serialize_with = "crate::nulstr::serialize::<_, 32>",
13539 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
13540 )
13541 )]
13542 #[cfg_attr(feature = "ts", ts(type = "string"))]
13543 pub model_name: [u8; 32],
13544 #[doc = "Custom name of the gimbal given to it by the user."]
13545 #[cfg_attr(
13546 feature = "serde",
13547 serde(
13548 serialize_with = "crate::nulstr::serialize::<_, 32>",
13549 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
13550 )
13551 )]
13552 #[cfg_attr(feature = "ts", ts(type = "string"))]
13553 pub custom_name: [u8; 32],
13554 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
13555 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13556 pub gimbal_device_id: u8,
13557}
13558impl GIMBAL_DEVICE_INFORMATION_DATA {
13559 pub const ENCODED_LEN: usize = 145usize;
13560 pub const DEFAULT: Self = Self {
13561 uid: 0_u64,
13562 time_boot_ms: 0_u32,
13563 firmware_version: 0_u32,
13564 hardware_version: 0_u32,
13565 roll_min: 0.0_f32,
13566 roll_max: 0.0_f32,
13567 pitch_min: 0.0_f32,
13568 pitch_max: 0.0_f32,
13569 yaw_min: 0.0_f32,
13570 yaw_max: 0.0_f32,
13571 cap_flags: GimbalDeviceCapFlags::DEFAULT,
13572 custom_cap_flags: 0_u16,
13573 vendor_name: [0_u8; 32usize],
13574 model_name: [0_u8; 32usize],
13575 custom_name: [0_u8; 32usize],
13576 gimbal_device_id: 0_u8,
13577 };
13578 #[cfg(feature = "arbitrary")]
13579 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13580 use arbitrary::{Arbitrary, Unstructured};
13581 let mut buf = [0u8; 1024];
13582 rng.fill_bytes(&mut buf);
13583 let mut unstructured = Unstructured::new(&buf);
13584 Self::arbitrary(&mut unstructured).unwrap_or_default()
13585 }
13586}
13587impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
13588 fn default() -> Self {
13589 Self::DEFAULT.clone()
13590 }
13591}
13592impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
13593 type Message = MavMessage;
13594 const ID: u32 = 283u32;
13595 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
13596 const EXTRA_CRC: u8 = 74u8;
13597 const ENCODED_LEN: usize = 145usize;
13598 fn deser(
13599 _version: MavlinkVersion,
13600 __input: &[u8],
13601 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13602 let avail_len = __input.len();
13603 let mut payload_buf = [0; Self::ENCODED_LEN];
13604 let mut buf = if avail_len < Self::ENCODED_LEN {
13605 payload_buf[0..avail_len].copy_from_slice(__input);
13606 Bytes::new(&payload_buf)
13607 } else {
13608 Bytes::new(__input)
13609 };
13610 let mut __struct = Self::default();
13611 __struct.uid = buf.get_u64_le();
13612 __struct.time_boot_ms = buf.get_u32_le();
13613 __struct.firmware_version = buf.get_u32_le();
13614 __struct.hardware_version = buf.get_u32_le();
13615 __struct.roll_min = buf.get_f32_le();
13616 __struct.roll_max = buf.get_f32_le();
13617 __struct.pitch_min = buf.get_f32_le();
13618 __struct.pitch_max = buf.get_f32_le();
13619 __struct.yaw_min = buf.get_f32_le();
13620 __struct.yaw_max = buf.get_f32_le();
13621 let tmp = buf.get_u16_le();
13622 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
13623 tmp & GimbalDeviceCapFlags::all().bits(),
13624 )
13625 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13626 flag_type: "GimbalDeviceCapFlags",
13627 value: tmp as u32,
13628 })?;
13629 __struct.custom_cap_flags = buf.get_u16_le();
13630 for v in &mut __struct.vendor_name {
13631 let val = buf.get_u8();
13632 *v = val;
13633 }
13634 for v in &mut __struct.model_name {
13635 let val = buf.get_u8();
13636 *v = val;
13637 }
13638 for v in &mut __struct.custom_name {
13639 let val = buf.get_u8();
13640 *v = val;
13641 }
13642 __struct.gimbal_device_id = buf.get_u8();
13643 Ok(__struct)
13644 }
13645 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13646 let mut __tmp = BytesMut::new(bytes);
13647 #[allow(clippy::absurd_extreme_comparisons)]
13648 #[allow(unused_comparisons)]
13649 if __tmp.remaining() < Self::ENCODED_LEN {
13650 panic!(
13651 "buffer is too small (need {} bytes, but got {})",
13652 Self::ENCODED_LEN,
13653 __tmp.remaining(),
13654 )
13655 }
13656 __tmp.put_u64_le(self.uid);
13657 __tmp.put_u32_le(self.time_boot_ms);
13658 __tmp.put_u32_le(self.firmware_version);
13659 __tmp.put_u32_le(self.hardware_version);
13660 __tmp.put_f32_le(self.roll_min);
13661 __tmp.put_f32_le(self.roll_max);
13662 __tmp.put_f32_le(self.pitch_min);
13663 __tmp.put_f32_le(self.pitch_max);
13664 __tmp.put_f32_le(self.yaw_min);
13665 __tmp.put_f32_le(self.yaw_max);
13666 __tmp.put_u16_le(self.cap_flags.bits());
13667 __tmp.put_u16_le(self.custom_cap_flags);
13668 for val in &self.vendor_name {
13669 __tmp.put_u8(*val);
13670 }
13671 for val in &self.model_name {
13672 __tmp.put_u8(*val);
13673 }
13674 for val in &self.custom_name {
13675 __tmp.put_u8(*val);
13676 }
13677 if matches!(version, MavlinkVersion::V2) {
13678 __tmp.put_u8(self.gimbal_device_id);
13679 let len = __tmp.len();
13680 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13681 } else {
13682 __tmp.len()
13683 }
13684 }
13685}
13686#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
13687#[doc = ""]
13688#[doc = "ID: 284"]
13689#[derive(Debug, Clone, PartialEq)]
13690#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13691#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13692#[cfg_attr(feature = "ts", derive(TS))]
13693#[cfg_attr(feature = "ts", ts(export))]
13694pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13695 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
13696 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13697 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13698 pub q: [f32; 4],
13699 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
13700 pub angular_velocity_x: f32,
13701 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
13702 pub angular_velocity_y: f32,
13703 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
13704 pub angular_velocity_z: f32,
13705 #[doc = "Low level gimbal flags."]
13706 pub flags: GimbalDeviceFlags,
13707 #[doc = "System ID"]
13708 pub target_system: u8,
13709 #[doc = "Component ID"]
13710 pub target_component: u8,
13711}
13712impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13713 pub const ENCODED_LEN: usize = 32usize;
13714 pub const DEFAULT: Self = Self {
13715 q: [0.0_f32; 4usize],
13716 angular_velocity_x: 0.0_f32,
13717 angular_velocity_y: 0.0_f32,
13718 angular_velocity_z: 0.0_f32,
13719 flags: GimbalDeviceFlags::DEFAULT,
13720 target_system: 0_u8,
13721 target_component: 0_u8,
13722 };
13723 #[cfg(feature = "arbitrary")]
13724 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13725 use arbitrary::{Arbitrary, Unstructured};
13726 let mut buf = [0u8; 1024];
13727 rng.fill_bytes(&mut buf);
13728 let mut unstructured = Unstructured::new(&buf);
13729 Self::arbitrary(&mut unstructured).unwrap_or_default()
13730 }
13731}
13732impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13733 fn default() -> Self {
13734 Self::DEFAULT.clone()
13735 }
13736}
13737impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13738 type Message = MavMessage;
13739 const ID: u32 = 284u32;
13740 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
13741 const EXTRA_CRC: u8 = 99u8;
13742 const ENCODED_LEN: usize = 32usize;
13743 fn deser(
13744 _version: MavlinkVersion,
13745 __input: &[u8],
13746 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13747 let avail_len = __input.len();
13748 let mut payload_buf = [0; Self::ENCODED_LEN];
13749 let mut buf = if avail_len < Self::ENCODED_LEN {
13750 payload_buf[0..avail_len].copy_from_slice(__input);
13751 Bytes::new(&payload_buf)
13752 } else {
13753 Bytes::new(__input)
13754 };
13755 let mut __struct = Self::default();
13756 for v in &mut __struct.q {
13757 let val = buf.get_f32_le();
13758 *v = val;
13759 }
13760 __struct.angular_velocity_x = buf.get_f32_le();
13761 __struct.angular_velocity_y = buf.get_f32_le();
13762 __struct.angular_velocity_z = buf.get_f32_le();
13763 let tmp = buf.get_u16_le();
13764 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
13765 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13766 flag_type: "GimbalDeviceFlags",
13767 value: tmp as u32,
13768 })?;
13769 __struct.target_system = buf.get_u8();
13770 __struct.target_component = buf.get_u8();
13771 Ok(__struct)
13772 }
13773 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13774 let mut __tmp = BytesMut::new(bytes);
13775 #[allow(clippy::absurd_extreme_comparisons)]
13776 #[allow(unused_comparisons)]
13777 if __tmp.remaining() < Self::ENCODED_LEN {
13778 panic!(
13779 "buffer is too small (need {} bytes, but got {})",
13780 Self::ENCODED_LEN,
13781 __tmp.remaining(),
13782 )
13783 }
13784 for val in &self.q {
13785 __tmp.put_f32_le(*val);
13786 }
13787 __tmp.put_f32_le(self.angular_velocity_x);
13788 __tmp.put_f32_le(self.angular_velocity_y);
13789 __tmp.put_f32_le(self.angular_velocity_z);
13790 __tmp.put_u16_le(self.flags.bits());
13791 __tmp.put_u8(self.target_system);
13792 __tmp.put_u8(self.target_component);
13793 if matches!(version, MavlinkVersion::V2) {
13794 let len = __tmp.len();
13795 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13796 } else {
13797 __tmp.len()
13798 }
13799 }
13800}
13801#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
13802#[doc = ""]
13803#[doc = "ID: 280"]
13804#[derive(Debug, Clone, PartialEq)]
13805#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13806#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13807#[cfg_attr(feature = "ts", derive(TS))]
13808#[cfg_attr(feature = "ts", ts(export))]
13809pub struct GIMBAL_MANAGER_INFORMATION_DATA {
13810 #[doc = "Timestamp (time since system boot)."]
13811 pub time_boot_ms: u32,
13812 #[doc = "Bitmap of gimbal capability flags."]
13813 pub cap_flags: GimbalManagerCapFlags,
13814 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
13815 pub roll_min: f32,
13816 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
13817 pub roll_max: f32,
13818 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
13819 pub pitch_min: f32,
13820 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
13821 pub pitch_max: f32,
13822 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
13823 pub yaw_min: f32,
13824 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
13825 pub yaw_max: f32,
13826 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13827 pub gimbal_device_id: u8,
13828}
13829impl GIMBAL_MANAGER_INFORMATION_DATA {
13830 pub const ENCODED_LEN: usize = 33usize;
13831 pub const DEFAULT: Self = Self {
13832 time_boot_ms: 0_u32,
13833 cap_flags: GimbalManagerCapFlags::DEFAULT,
13834 roll_min: 0.0_f32,
13835 roll_max: 0.0_f32,
13836 pitch_min: 0.0_f32,
13837 pitch_max: 0.0_f32,
13838 yaw_min: 0.0_f32,
13839 yaw_max: 0.0_f32,
13840 gimbal_device_id: 0_u8,
13841 };
13842 #[cfg(feature = "arbitrary")]
13843 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13844 use arbitrary::{Arbitrary, Unstructured};
13845 let mut buf = [0u8; 1024];
13846 rng.fill_bytes(&mut buf);
13847 let mut unstructured = Unstructured::new(&buf);
13848 Self::arbitrary(&mut unstructured).unwrap_or_default()
13849 }
13850}
13851impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
13852 fn default() -> Self {
13853 Self::DEFAULT.clone()
13854 }
13855}
13856impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
13857 type Message = MavMessage;
13858 const ID: u32 = 280u32;
13859 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
13860 const EXTRA_CRC: u8 = 70u8;
13861 const ENCODED_LEN: usize = 33usize;
13862 fn deser(
13863 _version: MavlinkVersion,
13864 __input: &[u8],
13865 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13866 let avail_len = __input.len();
13867 let mut payload_buf = [0; Self::ENCODED_LEN];
13868 let mut buf = if avail_len < Self::ENCODED_LEN {
13869 payload_buf[0..avail_len].copy_from_slice(__input);
13870 Bytes::new(&payload_buf)
13871 } else {
13872 Bytes::new(__input)
13873 };
13874 let mut __struct = Self::default();
13875 __struct.time_boot_ms = buf.get_u32_le();
13876 let tmp = buf.get_u32_le();
13877 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
13878 tmp & GimbalManagerCapFlags::all().bits(),
13879 )
13880 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13881 flag_type: "GimbalManagerCapFlags",
13882 value: tmp as u32,
13883 })?;
13884 __struct.roll_min = buf.get_f32_le();
13885 __struct.roll_max = buf.get_f32_le();
13886 __struct.pitch_min = buf.get_f32_le();
13887 __struct.pitch_max = buf.get_f32_le();
13888 __struct.yaw_min = buf.get_f32_le();
13889 __struct.yaw_max = buf.get_f32_le();
13890 __struct.gimbal_device_id = buf.get_u8();
13891 Ok(__struct)
13892 }
13893 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13894 let mut __tmp = BytesMut::new(bytes);
13895 #[allow(clippy::absurd_extreme_comparisons)]
13896 #[allow(unused_comparisons)]
13897 if __tmp.remaining() < Self::ENCODED_LEN {
13898 panic!(
13899 "buffer is too small (need {} bytes, but got {})",
13900 Self::ENCODED_LEN,
13901 __tmp.remaining(),
13902 )
13903 }
13904 __tmp.put_u32_le(self.time_boot_ms);
13905 __tmp.put_u32_le(self.cap_flags.bits());
13906 __tmp.put_f32_le(self.roll_min);
13907 __tmp.put_f32_le(self.roll_max);
13908 __tmp.put_f32_le(self.pitch_min);
13909 __tmp.put_f32_le(self.pitch_max);
13910 __tmp.put_f32_le(self.yaw_min);
13911 __tmp.put_f32_le(self.yaw_max);
13912 __tmp.put_u8(self.gimbal_device_id);
13913 if matches!(version, MavlinkVersion::V2) {
13914 let len = __tmp.len();
13915 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13916 } else {
13917 __tmp.len()
13918 }
13919 }
13920}
13921#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13922#[doc = ""]
13923#[doc = "ID: 282"]
13924#[derive(Debug, Clone, PartialEq)]
13925#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13926#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13927#[cfg_attr(feature = "ts", derive(TS))]
13928#[cfg_attr(feature = "ts", ts(export))]
13929pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13930 #[doc = "High level gimbal manager flags to use."]
13931 pub flags: GimbalManagerFlags,
13932 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
13933 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13934 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13935 pub q: [f32; 4],
13936 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
13937 pub angular_velocity_x: f32,
13938 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
13939 pub angular_velocity_y: f32,
13940 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
13941 pub angular_velocity_z: f32,
13942 #[doc = "System ID"]
13943 pub target_system: u8,
13944 #[doc = "Component ID"]
13945 pub target_component: u8,
13946 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13947 pub gimbal_device_id: u8,
13948}
13949impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13950 pub const ENCODED_LEN: usize = 35usize;
13951 pub const DEFAULT: Self = Self {
13952 flags: GimbalManagerFlags::DEFAULT,
13953 q: [0.0_f32; 4usize],
13954 angular_velocity_x: 0.0_f32,
13955 angular_velocity_y: 0.0_f32,
13956 angular_velocity_z: 0.0_f32,
13957 target_system: 0_u8,
13958 target_component: 0_u8,
13959 gimbal_device_id: 0_u8,
13960 };
13961 #[cfg(feature = "arbitrary")]
13962 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13963 use arbitrary::{Arbitrary, Unstructured};
13964 let mut buf = [0u8; 1024];
13965 rng.fill_bytes(&mut buf);
13966 let mut unstructured = Unstructured::new(&buf);
13967 Self::arbitrary(&mut unstructured).unwrap_or_default()
13968 }
13969}
13970impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13971 fn default() -> Self {
13972 Self::DEFAULT.clone()
13973 }
13974}
13975impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13976 type Message = MavMessage;
13977 const ID: u32 = 282u32;
13978 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
13979 const EXTRA_CRC: u8 = 123u8;
13980 const ENCODED_LEN: usize = 35usize;
13981 fn deser(
13982 _version: MavlinkVersion,
13983 __input: &[u8],
13984 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13985 let avail_len = __input.len();
13986 let mut payload_buf = [0; Self::ENCODED_LEN];
13987 let mut buf = if avail_len < Self::ENCODED_LEN {
13988 payload_buf[0..avail_len].copy_from_slice(__input);
13989 Bytes::new(&payload_buf)
13990 } else {
13991 Bytes::new(__input)
13992 };
13993 let mut __struct = Self::default();
13994 let tmp = buf.get_u32_le();
13995 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13996 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13997 flag_type: "GimbalManagerFlags",
13998 value: tmp as u32,
13999 })?;
14000 for v in &mut __struct.q {
14001 let val = buf.get_f32_le();
14002 *v = val;
14003 }
14004 __struct.angular_velocity_x = buf.get_f32_le();
14005 __struct.angular_velocity_y = buf.get_f32_le();
14006 __struct.angular_velocity_z = buf.get_f32_le();
14007 __struct.target_system = buf.get_u8();
14008 __struct.target_component = buf.get_u8();
14009 __struct.gimbal_device_id = buf.get_u8();
14010 Ok(__struct)
14011 }
14012 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14013 let mut __tmp = BytesMut::new(bytes);
14014 #[allow(clippy::absurd_extreme_comparisons)]
14015 #[allow(unused_comparisons)]
14016 if __tmp.remaining() < Self::ENCODED_LEN {
14017 panic!(
14018 "buffer is too small (need {} bytes, but got {})",
14019 Self::ENCODED_LEN,
14020 __tmp.remaining(),
14021 )
14022 }
14023 __tmp.put_u32_le(self.flags.bits());
14024 for val in &self.q {
14025 __tmp.put_f32_le(*val);
14026 }
14027 __tmp.put_f32_le(self.angular_velocity_x);
14028 __tmp.put_f32_le(self.angular_velocity_y);
14029 __tmp.put_f32_le(self.angular_velocity_z);
14030 __tmp.put_u8(self.target_system);
14031 __tmp.put_u8(self.target_component);
14032 __tmp.put_u8(self.gimbal_device_id);
14033 if matches!(version, MavlinkVersion::V2) {
14034 let len = __tmp.len();
14035 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14036 } else {
14037 __tmp.len()
14038 }
14039 }
14040}
14041#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
14042#[doc = ""]
14043#[doc = "ID: 288"]
14044#[derive(Debug, Clone, PartialEq)]
14045#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14046#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14047#[cfg_attr(feature = "ts", derive(TS))]
14048#[cfg_attr(feature = "ts", ts(export))]
14049pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
14050 #[doc = "High level gimbal manager flags."]
14051 pub flags: GimbalManagerFlags,
14052 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
14053 pub pitch: f32,
14054 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
14055 pub yaw: f32,
14056 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
14057 pub pitch_rate: f32,
14058 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
14059 pub yaw_rate: f32,
14060 #[doc = "System ID"]
14061 pub target_system: u8,
14062 #[doc = "Component ID"]
14063 pub target_component: u8,
14064 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
14065 pub gimbal_device_id: u8,
14066}
14067impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
14068 pub const ENCODED_LEN: usize = 23usize;
14069 pub const DEFAULT: Self = Self {
14070 flags: GimbalManagerFlags::DEFAULT,
14071 pitch: 0.0_f32,
14072 yaw: 0.0_f32,
14073 pitch_rate: 0.0_f32,
14074 yaw_rate: 0.0_f32,
14075 target_system: 0_u8,
14076 target_component: 0_u8,
14077 gimbal_device_id: 0_u8,
14078 };
14079 #[cfg(feature = "arbitrary")]
14080 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14081 use arbitrary::{Arbitrary, Unstructured};
14082 let mut buf = [0u8; 1024];
14083 rng.fill_bytes(&mut buf);
14084 let mut unstructured = Unstructured::new(&buf);
14085 Self::arbitrary(&mut unstructured).unwrap_or_default()
14086 }
14087}
14088impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
14089 fn default() -> Self {
14090 Self::DEFAULT.clone()
14091 }
14092}
14093impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
14094 type Message = MavMessage;
14095 const ID: u32 = 288u32;
14096 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
14097 const EXTRA_CRC: u8 = 20u8;
14098 const ENCODED_LEN: usize = 23usize;
14099 fn deser(
14100 _version: MavlinkVersion,
14101 __input: &[u8],
14102 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14103 let avail_len = __input.len();
14104 let mut payload_buf = [0; Self::ENCODED_LEN];
14105 let mut buf = if avail_len < Self::ENCODED_LEN {
14106 payload_buf[0..avail_len].copy_from_slice(__input);
14107 Bytes::new(&payload_buf)
14108 } else {
14109 Bytes::new(__input)
14110 };
14111 let mut __struct = Self::default();
14112 let tmp = buf.get_u32_le();
14113 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
14114 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14115 flag_type: "GimbalManagerFlags",
14116 value: tmp as u32,
14117 })?;
14118 __struct.pitch = buf.get_f32_le();
14119 __struct.yaw = buf.get_f32_le();
14120 __struct.pitch_rate = buf.get_f32_le();
14121 __struct.yaw_rate = buf.get_f32_le();
14122 __struct.target_system = buf.get_u8();
14123 __struct.target_component = buf.get_u8();
14124 __struct.gimbal_device_id = buf.get_u8();
14125 Ok(__struct)
14126 }
14127 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14128 let mut __tmp = BytesMut::new(bytes);
14129 #[allow(clippy::absurd_extreme_comparisons)]
14130 #[allow(unused_comparisons)]
14131 if __tmp.remaining() < Self::ENCODED_LEN {
14132 panic!(
14133 "buffer is too small (need {} bytes, but got {})",
14134 Self::ENCODED_LEN,
14135 __tmp.remaining(),
14136 )
14137 }
14138 __tmp.put_u32_le(self.flags.bits());
14139 __tmp.put_f32_le(self.pitch);
14140 __tmp.put_f32_le(self.yaw);
14141 __tmp.put_f32_le(self.pitch_rate);
14142 __tmp.put_f32_le(self.yaw_rate);
14143 __tmp.put_u8(self.target_system);
14144 __tmp.put_u8(self.target_component);
14145 __tmp.put_u8(self.gimbal_device_id);
14146 if matches!(version, MavlinkVersion::V2) {
14147 let len = __tmp.len();
14148 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14149 } else {
14150 __tmp.len()
14151 }
14152 }
14153}
14154#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
14155#[doc = ""]
14156#[doc = "ID: 287"]
14157#[derive(Debug, Clone, PartialEq)]
14158#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14159#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14160#[cfg_attr(feature = "ts", derive(TS))]
14161#[cfg_attr(feature = "ts", ts(export))]
14162pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
14163 #[doc = "High level gimbal manager flags to use."]
14164 pub flags: GimbalManagerFlags,
14165 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
14166 pub pitch: f32,
14167 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
14168 pub yaw: f32,
14169 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
14170 pub pitch_rate: f32,
14171 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
14172 pub yaw_rate: f32,
14173 #[doc = "System ID"]
14174 pub target_system: u8,
14175 #[doc = "Component ID"]
14176 pub target_component: u8,
14177 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
14178 pub gimbal_device_id: u8,
14179}
14180impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
14181 pub const ENCODED_LEN: usize = 23usize;
14182 pub const DEFAULT: Self = Self {
14183 flags: GimbalManagerFlags::DEFAULT,
14184 pitch: 0.0_f32,
14185 yaw: 0.0_f32,
14186 pitch_rate: 0.0_f32,
14187 yaw_rate: 0.0_f32,
14188 target_system: 0_u8,
14189 target_component: 0_u8,
14190 gimbal_device_id: 0_u8,
14191 };
14192 #[cfg(feature = "arbitrary")]
14193 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14194 use arbitrary::{Arbitrary, Unstructured};
14195 let mut buf = [0u8; 1024];
14196 rng.fill_bytes(&mut buf);
14197 let mut unstructured = Unstructured::new(&buf);
14198 Self::arbitrary(&mut unstructured).unwrap_or_default()
14199 }
14200}
14201impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
14202 fn default() -> Self {
14203 Self::DEFAULT.clone()
14204 }
14205}
14206impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
14207 type Message = MavMessage;
14208 const ID: u32 = 287u32;
14209 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
14210 const EXTRA_CRC: u8 = 1u8;
14211 const ENCODED_LEN: usize = 23usize;
14212 fn deser(
14213 _version: MavlinkVersion,
14214 __input: &[u8],
14215 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14216 let avail_len = __input.len();
14217 let mut payload_buf = [0; Self::ENCODED_LEN];
14218 let mut buf = if avail_len < Self::ENCODED_LEN {
14219 payload_buf[0..avail_len].copy_from_slice(__input);
14220 Bytes::new(&payload_buf)
14221 } else {
14222 Bytes::new(__input)
14223 };
14224 let mut __struct = Self::default();
14225 let tmp = buf.get_u32_le();
14226 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
14227 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14228 flag_type: "GimbalManagerFlags",
14229 value: tmp as u32,
14230 })?;
14231 __struct.pitch = buf.get_f32_le();
14232 __struct.yaw = buf.get_f32_le();
14233 __struct.pitch_rate = buf.get_f32_le();
14234 __struct.yaw_rate = buf.get_f32_le();
14235 __struct.target_system = buf.get_u8();
14236 __struct.target_component = buf.get_u8();
14237 __struct.gimbal_device_id = buf.get_u8();
14238 Ok(__struct)
14239 }
14240 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14241 let mut __tmp = BytesMut::new(bytes);
14242 #[allow(clippy::absurd_extreme_comparisons)]
14243 #[allow(unused_comparisons)]
14244 if __tmp.remaining() < Self::ENCODED_LEN {
14245 panic!(
14246 "buffer is too small (need {} bytes, but got {})",
14247 Self::ENCODED_LEN,
14248 __tmp.remaining(),
14249 )
14250 }
14251 __tmp.put_u32_le(self.flags.bits());
14252 __tmp.put_f32_le(self.pitch);
14253 __tmp.put_f32_le(self.yaw);
14254 __tmp.put_f32_le(self.pitch_rate);
14255 __tmp.put_f32_le(self.yaw_rate);
14256 __tmp.put_u8(self.target_system);
14257 __tmp.put_u8(self.target_component);
14258 __tmp.put_u8(self.gimbal_device_id);
14259 if matches!(version, MavlinkVersion::V2) {
14260 let len = __tmp.len();
14261 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14262 } else {
14263 __tmp.len()
14264 }
14265 }
14266}
14267#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
14268#[doc = ""]
14269#[doc = "ID: 281"]
14270#[derive(Debug, Clone, PartialEq)]
14271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14273#[cfg_attr(feature = "ts", derive(TS))]
14274#[cfg_attr(feature = "ts", ts(export))]
14275pub struct GIMBAL_MANAGER_STATUS_DATA {
14276 #[doc = "Timestamp (time since system boot)."]
14277 pub time_boot_ms: u32,
14278 #[doc = "High level gimbal manager flags currently applied."]
14279 pub flags: GimbalManagerFlags,
14280 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
14281 pub gimbal_device_id: u8,
14282 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
14283 pub primary_control_sysid: u8,
14284 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
14285 pub primary_control_compid: u8,
14286 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
14287 pub secondary_control_sysid: u8,
14288 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
14289 pub secondary_control_compid: u8,
14290}
14291impl GIMBAL_MANAGER_STATUS_DATA {
14292 pub const ENCODED_LEN: usize = 13usize;
14293 pub const DEFAULT: Self = Self {
14294 time_boot_ms: 0_u32,
14295 flags: GimbalManagerFlags::DEFAULT,
14296 gimbal_device_id: 0_u8,
14297 primary_control_sysid: 0_u8,
14298 primary_control_compid: 0_u8,
14299 secondary_control_sysid: 0_u8,
14300 secondary_control_compid: 0_u8,
14301 };
14302 #[cfg(feature = "arbitrary")]
14303 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14304 use arbitrary::{Arbitrary, Unstructured};
14305 let mut buf = [0u8; 1024];
14306 rng.fill_bytes(&mut buf);
14307 let mut unstructured = Unstructured::new(&buf);
14308 Self::arbitrary(&mut unstructured).unwrap_or_default()
14309 }
14310}
14311impl Default for GIMBAL_MANAGER_STATUS_DATA {
14312 fn default() -> Self {
14313 Self::DEFAULT.clone()
14314 }
14315}
14316impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
14317 type Message = MavMessage;
14318 const ID: u32 = 281u32;
14319 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
14320 const EXTRA_CRC: u8 = 48u8;
14321 const ENCODED_LEN: usize = 13usize;
14322 fn deser(
14323 _version: MavlinkVersion,
14324 __input: &[u8],
14325 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14326 let avail_len = __input.len();
14327 let mut payload_buf = [0; Self::ENCODED_LEN];
14328 let mut buf = if avail_len < Self::ENCODED_LEN {
14329 payload_buf[0..avail_len].copy_from_slice(__input);
14330 Bytes::new(&payload_buf)
14331 } else {
14332 Bytes::new(__input)
14333 };
14334 let mut __struct = Self::default();
14335 __struct.time_boot_ms = buf.get_u32_le();
14336 let tmp = buf.get_u32_le();
14337 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
14338 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14339 flag_type: "GimbalManagerFlags",
14340 value: tmp as u32,
14341 })?;
14342 __struct.gimbal_device_id = buf.get_u8();
14343 __struct.primary_control_sysid = buf.get_u8();
14344 __struct.primary_control_compid = buf.get_u8();
14345 __struct.secondary_control_sysid = buf.get_u8();
14346 __struct.secondary_control_compid = buf.get_u8();
14347 Ok(__struct)
14348 }
14349 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14350 let mut __tmp = BytesMut::new(bytes);
14351 #[allow(clippy::absurd_extreme_comparisons)]
14352 #[allow(unused_comparisons)]
14353 if __tmp.remaining() < Self::ENCODED_LEN {
14354 panic!(
14355 "buffer is too small (need {} bytes, but got {})",
14356 Self::ENCODED_LEN,
14357 __tmp.remaining(),
14358 )
14359 }
14360 __tmp.put_u32_le(self.time_boot_ms);
14361 __tmp.put_u32_le(self.flags.bits());
14362 __tmp.put_u8(self.gimbal_device_id);
14363 __tmp.put_u8(self.primary_control_sysid);
14364 __tmp.put_u8(self.primary_control_compid);
14365 __tmp.put_u8(self.secondary_control_sysid);
14366 __tmp.put_u8(self.secondary_control_compid);
14367 if matches!(version, MavlinkVersion::V2) {
14368 let len = __tmp.len();
14369 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14370 } else {
14371 __tmp.len()
14372 }
14373 }
14374}
14375#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
14376#[doc = ""]
14377#[doc = "ID: 33"]
14378#[derive(Debug, Clone, PartialEq)]
14379#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14380#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14381#[cfg_attr(feature = "ts", derive(TS))]
14382#[cfg_attr(feature = "ts", ts(export))]
14383pub struct GLOBAL_POSITION_INT_DATA {
14384 #[doc = "Timestamp (time since system boot)."]
14385 pub time_boot_ms: u32,
14386 #[doc = "Latitude, expressed"]
14387 pub lat: i32,
14388 #[doc = "Longitude, expressed"]
14389 pub lon: i32,
14390 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
14391 pub alt: i32,
14392 #[doc = "Altitude above home"]
14393 pub relative_alt: i32,
14394 #[doc = "Ground X Speed (Latitude, positive north)"]
14395 pub vx: i16,
14396 #[doc = "Ground Y Speed (Longitude, positive east)"]
14397 pub vy: i16,
14398 #[doc = "Ground Z Speed (Altitude, positive down)"]
14399 pub vz: i16,
14400 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14401 pub hdg: u16,
14402}
14403impl GLOBAL_POSITION_INT_DATA {
14404 pub const ENCODED_LEN: usize = 28usize;
14405 pub const DEFAULT: Self = Self {
14406 time_boot_ms: 0_u32,
14407 lat: 0_i32,
14408 lon: 0_i32,
14409 alt: 0_i32,
14410 relative_alt: 0_i32,
14411 vx: 0_i16,
14412 vy: 0_i16,
14413 vz: 0_i16,
14414 hdg: 0_u16,
14415 };
14416 #[cfg(feature = "arbitrary")]
14417 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14418 use arbitrary::{Arbitrary, Unstructured};
14419 let mut buf = [0u8; 1024];
14420 rng.fill_bytes(&mut buf);
14421 let mut unstructured = Unstructured::new(&buf);
14422 Self::arbitrary(&mut unstructured).unwrap_or_default()
14423 }
14424}
14425impl Default for GLOBAL_POSITION_INT_DATA {
14426 fn default() -> Self {
14427 Self::DEFAULT.clone()
14428 }
14429}
14430impl MessageData for GLOBAL_POSITION_INT_DATA {
14431 type Message = MavMessage;
14432 const ID: u32 = 33u32;
14433 const NAME: &'static str = "GLOBAL_POSITION_INT";
14434 const EXTRA_CRC: u8 = 104u8;
14435 const ENCODED_LEN: usize = 28usize;
14436 fn deser(
14437 _version: MavlinkVersion,
14438 __input: &[u8],
14439 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14440 let avail_len = __input.len();
14441 let mut payload_buf = [0; Self::ENCODED_LEN];
14442 let mut buf = if avail_len < Self::ENCODED_LEN {
14443 payload_buf[0..avail_len].copy_from_slice(__input);
14444 Bytes::new(&payload_buf)
14445 } else {
14446 Bytes::new(__input)
14447 };
14448 let mut __struct = Self::default();
14449 __struct.time_boot_ms = buf.get_u32_le();
14450 __struct.lat = buf.get_i32_le();
14451 __struct.lon = buf.get_i32_le();
14452 __struct.alt = buf.get_i32_le();
14453 __struct.relative_alt = buf.get_i32_le();
14454 __struct.vx = buf.get_i16_le();
14455 __struct.vy = buf.get_i16_le();
14456 __struct.vz = buf.get_i16_le();
14457 __struct.hdg = buf.get_u16_le();
14458 Ok(__struct)
14459 }
14460 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14461 let mut __tmp = BytesMut::new(bytes);
14462 #[allow(clippy::absurd_extreme_comparisons)]
14463 #[allow(unused_comparisons)]
14464 if __tmp.remaining() < Self::ENCODED_LEN {
14465 panic!(
14466 "buffer is too small (need {} bytes, but got {})",
14467 Self::ENCODED_LEN,
14468 __tmp.remaining(),
14469 )
14470 }
14471 __tmp.put_u32_le(self.time_boot_ms);
14472 __tmp.put_i32_le(self.lat);
14473 __tmp.put_i32_le(self.lon);
14474 __tmp.put_i32_le(self.alt);
14475 __tmp.put_i32_le(self.relative_alt);
14476 __tmp.put_i16_le(self.vx);
14477 __tmp.put_i16_le(self.vy);
14478 __tmp.put_i16_le(self.vz);
14479 __tmp.put_u16_le(self.hdg);
14480 if matches!(version, MavlinkVersion::V2) {
14481 let len = __tmp.len();
14482 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14483 } else {
14484 __tmp.len()
14485 }
14486 }
14487}
14488#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
14489#[doc = ""]
14490#[doc = "ID: 63"]
14491#[derive(Debug, Clone, PartialEq)]
14492#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14493#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14494#[cfg_attr(feature = "ts", derive(TS))]
14495#[cfg_attr(feature = "ts", ts(export))]
14496pub struct GLOBAL_POSITION_INT_COV_DATA {
14497 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14498 pub time_usec: u64,
14499 #[doc = "Latitude"]
14500 pub lat: i32,
14501 #[doc = "Longitude"]
14502 pub lon: i32,
14503 #[doc = "Altitude in meters above MSL"]
14504 pub alt: i32,
14505 #[doc = "Altitude above ground"]
14506 pub relative_alt: i32,
14507 #[doc = "Ground X Speed (Latitude)"]
14508 pub vx: f32,
14509 #[doc = "Ground Y Speed (Longitude)"]
14510 pub vy: f32,
14511 #[doc = "Ground Z Speed (Altitude)"]
14512 pub vz: f32,
14513 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
14514 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14515 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14516 pub covariance: [f32; 36],
14517 #[doc = "Class id of the estimator this estimate originated from."]
14518 pub estimator_type: MavEstimatorType,
14519}
14520impl GLOBAL_POSITION_INT_COV_DATA {
14521 pub const ENCODED_LEN: usize = 181usize;
14522 pub const DEFAULT: Self = Self {
14523 time_usec: 0_u64,
14524 lat: 0_i32,
14525 lon: 0_i32,
14526 alt: 0_i32,
14527 relative_alt: 0_i32,
14528 vx: 0.0_f32,
14529 vy: 0.0_f32,
14530 vz: 0.0_f32,
14531 covariance: [0.0_f32; 36usize],
14532 estimator_type: MavEstimatorType::DEFAULT,
14533 };
14534 #[cfg(feature = "arbitrary")]
14535 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14536 use arbitrary::{Arbitrary, Unstructured};
14537 let mut buf = [0u8; 1024];
14538 rng.fill_bytes(&mut buf);
14539 let mut unstructured = Unstructured::new(&buf);
14540 Self::arbitrary(&mut unstructured).unwrap_or_default()
14541 }
14542}
14543impl Default for GLOBAL_POSITION_INT_COV_DATA {
14544 fn default() -> Self {
14545 Self::DEFAULT.clone()
14546 }
14547}
14548impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
14549 type Message = MavMessage;
14550 const ID: u32 = 63u32;
14551 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
14552 const EXTRA_CRC: u8 = 119u8;
14553 const ENCODED_LEN: usize = 181usize;
14554 fn deser(
14555 _version: MavlinkVersion,
14556 __input: &[u8],
14557 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14558 let avail_len = __input.len();
14559 let mut payload_buf = [0; Self::ENCODED_LEN];
14560 let mut buf = if avail_len < Self::ENCODED_LEN {
14561 payload_buf[0..avail_len].copy_from_slice(__input);
14562 Bytes::new(&payload_buf)
14563 } else {
14564 Bytes::new(__input)
14565 };
14566 let mut __struct = Self::default();
14567 __struct.time_usec = buf.get_u64_le();
14568 __struct.lat = buf.get_i32_le();
14569 __struct.lon = buf.get_i32_le();
14570 __struct.alt = buf.get_i32_le();
14571 __struct.relative_alt = buf.get_i32_le();
14572 __struct.vx = buf.get_f32_le();
14573 __struct.vy = buf.get_f32_le();
14574 __struct.vz = buf.get_f32_le();
14575 for v in &mut __struct.covariance {
14576 let val = buf.get_f32_le();
14577 *v = val;
14578 }
14579 let tmp = buf.get_u8();
14580 __struct.estimator_type =
14581 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14582 enum_type: "MavEstimatorType",
14583 value: tmp as u32,
14584 })?;
14585 Ok(__struct)
14586 }
14587 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14588 let mut __tmp = BytesMut::new(bytes);
14589 #[allow(clippy::absurd_extreme_comparisons)]
14590 #[allow(unused_comparisons)]
14591 if __tmp.remaining() < Self::ENCODED_LEN {
14592 panic!(
14593 "buffer is too small (need {} bytes, but got {})",
14594 Self::ENCODED_LEN,
14595 __tmp.remaining(),
14596 )
14597 }
14598 __tmp.put_u64_le(self.time_usec);
14599 __tmp.put_i32_le(self.lat);
14600 __tmp.put_i32_le(self.lon);
14601 __tmp.put_i32_le(self.alt);
14602 __tmp.put_i32_le(self.relative_alt);
14603 __tmp.put_f32_le(self.vx);
14604 __tmp.put_f32_le(self.vy);
14605 __tmp.put_f32_le(self.vz);
14606 for val in &self.covariance {
14607 __tmp.put_f32_le(*val);
14608 }
14609 __tmp.put_u8(self.estimator_type as u8);
14610 if matches!(version, MavlinkVersion::V2) {
14611 let len = __tmp.len();
14612 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14613 } else {
14614 __tmp.len()
14615 }
14616 }
14617}
14618#[doc = "Global position/attitude estimate from a vision source."]
14619#[doc = ""]
14620#[doc = "ID: 101"]
14621#[derive(Debug, Clone, PartialEq)]
14622#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14623#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14624#[cfg_attr(feature = "ts", derive(TS))]
14625#[cfg_attr(feature = "ts", ts(export))]
14626pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14627 #[doc = "Timestamp (UNIX time or since system boot)"]
14628 pub usec: u64,
14629 #[doc = "Global X position"]
14630 pub x: f32,
14631 #[doc = "Global Y position"]
14632 pub y: f32,
14633 #[doc = "Global Z position"]
14634 pub z: f32,
14635 #[doc = "Roll angle"]
14636 pub roll: f32,
14637 #[doc = "Pitch angle"]
14638 pub pitch: f32,
14639 #[doc = "Yaw angle"]
14640 pub yaw: f32,
14641 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
14642 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14643 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14644 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14645 pub covariance: [f32; 21],
14646 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
14647 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14648 pub reset_counter: u8,
14649}
14650impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14651 pub const ENCODED_LEN: usize = 117usize;
14652 pub const DEFAULT: Self = Self {
14653 usec: 0_u64,
14654 x: 0.0_f32,
14655 y: 0.0_f32,
14656 z: 0.0_f32,
14657 roll: 0.0_f32,
14658 pitch: 0.0_f32,
14659 yaw: 0.0_f32,
14660 covariance: [0.0_f32; 21usize],
14661 reset_counter: 0_u8,
14662 };
14663 #[cfg(feature = "arbitrary")]
14664 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14665 use arbitrary::{Arbitrary, Unstructured};
14666 let mut buf = [0u8; 1024];
14667 rng.fill_bytes(&mut buf);
14668 let mut unstructured = Unstructured::new(&buf);
14669 Self::arbitrary(&mut unstructured).unwrap_or_default()
14670 }
14671}
14672impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14673 fn default() -> Self {
14674 Self::DEFAULT.clone()
14675 }
14676}
14677impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14678 type Message = MavMessage;
14679 const ID: u32 = 101u32;
14680 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
14681 const EXTRA_CRC: u8 = 102u8;
14682 const ENCODED_LEN: usize = 117usize;
14683 fn deser(
14684 _version: MavlinkVersion,
14685 __input: &[u8],
14686 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14687 let avail_len = __input.len();
14688 let mut payload_buf = [0; Self::ENCODED_LEN];
14689 let mut buf = if avail_len < Self::ENCODED_LEN {
14690 payload_buf[0..avail_len].copy_from_slice(__input);
14691 Bytes::new(&payload_buf)
14692 } else {
14693 Bytes::new(__input)
14694 };
14695 let mut __struct = Self::default();
14696 __struct.usec = buf.get_u64_le();
14697 __struct.x = buf.get_f32_le();
14698 __struct.y = buf.get_f32_le();
14699 __struct.z = buf.get_f32_le();
14700 __struct.roll = buf.get_f32_le();
14701 __struct.pitch = buf.get_f32_le();
14702 __struct.yaw = buf.get_f32_le();
14703 for v in &mut __struct.covariance {
14704 let val = buf.get_f32_le();
14705 *v = val;
14706 }
14707 __struct.reset_counter = buf.get_u8();
14708 Ok(__struct)
14709 }
14710 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14711 let mut __tmp = BytesMut::new(bytes);
14712 #[allow(clippy::absurd_extreme_comparisons)]
14713 #[allow(unused_comparisons)]
14714 if __tmp.remaining() < Self::ENCODED_LEN {
14715 panic!(
14716 "buffer is too small (need {} bytes, but got {})",
14717 Self::ENCODED_LEN,
14718 __tmp.remaining(),
14719 )
14720 }
14721 __tmp.put_u64_le(self.usec);
14722 __tmp.put_f32_le(self.x);
14723 __tmp.put_f32_le(self.y);
14724 __tmp.put_f32_le(self.z);
14725 __tmp.put_f32_le(self.roll);
14726 __tmp.put_f32_le(self.pitch);
14727 __tmp.put_f32_le(self.yaw);
14728 if matches!(version, MavlinkVersion::V2) {
14729 for val in &self.covariance {
14730 __tmp.put_f32_le(*val);
14731 }
14732 __tmp.put_u8(self.reset_counter);
14733 let len = __tmp.len();
14734 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14735 } else {
14736 __tmp.len()
14737 }
14738 }
14739}
14740#[doc = "Second GPS data."]
14741#[doc = ""]
14742#[doc = "ID: 124"]
14743#[derive(Debug, Clone, PartialEq)]
14744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14745#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14746#[cfg_attr(feature = "ts", derive(TS))]
14747#[cfg_attr(feature = "ts", ts(export))]
14748pub struct GPS2_RAW_DATA {
14749 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14750 pub time_usec: u64,
14751 #[doc = "Latitude (WGS84)"]
14752 pub lat: i32,
14753 #[doc = "Longitude (WGS84)"]
14754 pub lon: i32,
14755 #[doc = "Altitude (MSL). Positive for up."]
14756 pub alt: i32,
14757 #[doc = "Age of DGPS info"]
14758 pub dgps_age: u32,
14759 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14760 pub eph: u16,
14761 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14762 pub epv: u16,
14763 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14764 pub vel: u16,
14765 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14766 pub cog: u16,
14767 #[doc = "GPS fix type."]
14768 pub fix_type: GpsFixType,
14769 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14770 pub satellites_visible: u8,
14771 #[doc = "Number of DGPS satellites"]
14772 pub dgps_numch: u8,
14773 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14774 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14775 pub yaw: u16,
14776 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14777 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14778 pub alt_ellipsoid: i32,
14779 #[doc = "Position uncertainty."]
14780 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14781 pub h_acc: u32,
14782 #[doc = "Altitude uncertainty."]
14783 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14784 pub v_acc: u32,
14785 #[doc = "Speed uncertainty."]
14786 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14787 pub vel_acc: u32,
14788 #[doc = "Heading / track uncertainty"]
14789 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14790 pub hdg_acc: u32,
14791}
14792impl GPS2_RAW_DATA {
14793 pub const ENCODED_LEN: usize = 57usize;
14794 pub const DEFAULT: Self = Self {
14795 time_usec: 0_u64,
14796 lat: 0_i32,
14797 lon: 0_i32,
14798 alt: 0_i32,
14799 dgps_age: 0_u32,
14800 eph: 0_u16,
14801 epv: 0_u16,
14802 vel: 0_u16,
14803 cog: 0_u16,
14804 fix_type: GpsFixType::DEFAULT,
14805 satellites_visible: 0_u8,
14806 dgps_numch: 0_u8,
14807 yaw: 0_u16,
14808 alt_ellipsoid: 0_i32,
14809 h_acc: 0_u32,
14810 v_acc: 0_u32,
14811 vel_acc: 0_u32,
14812 hdg_acc: 0_u32,
14813 };
14814 #[cfg(feature = "arbitrary")]
14815 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14816 use arbitrary::{Arbitrary, Unstructured};
14817 let mut buf = [0u8; 1024];
14818 rng.fill_bytes(&mut buf);
14819 let mut unstructured = Unstructured::new(&buf);
14820 Self::arbitrary(&mut unstructured).unwrap_or_default()
14821 }
14822}
14823impl Default for GPS2_RAW_DATA {
14824 fn default() -> Self {
14825 Self::DEFAULT.clone()
14826 }
14827}
14828impl MessageData for GPS2_RAW_DATA {
14829 type Message = MavMessage;
14830 const ID: u32 = 124u32;
14831 const NAME: &'static str = "GPS2_RAW";
14832 const EXTRA_CRC: u8 = 87u8;
14833 const ENCODED_LEN: usize = 57usize;
14834 fn deser(
14835 _version: MavlinkVersion,
14836 __input: &[u8],
14837 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14838 let avail_len = __input.len();
14839 let mut payload_buf = [0; Self::ENCODED_LEN];
14840 let mut buf = if avail_len < Self::ENCODED_LEN {
14841 payload_buf[0..avail_len].copy_from_slice(__input);
14842 Bytes::new(&payload_buf)
14843 } else {
14844 Bytes::new(__input)
14845 };
14846 let mut __struct = Self::default();
14847 __struct.time_usec = buf.get_u64_le();
14848 __struct.lat = buf.get_i32_le();
14849 __struct.lon = buf.get_i32_le();
14850 __struct.alt = buf.get_i32_le();
14851 __struct.dgps_age = buf.get_u32_le();
14852 __struct.eph = buf.get_u16_le();
14853 __struct.epv = buf.get_u16_le();
14854 __struct.vel = buf.get_u16_le();
14855 __struct.cog = buf.get_u16_le();
14856 let tmp = buf.get_u8();
14857 __struct.fix_type =
14858 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14859 enum_type: "GpsFixType",
14860 value: tmp as u32,
14861 })?;
14862 __struct.satellites_visible = buf.get_u8();
14863 __struct.dgps_numch = buf.get_u8();
14864 __struct.yaw = buf.get_u16_le();
14865 __struct.alt_ellipsoid = buf.get_i32_le();
14866 __struct.h_acc = buf.get_u32_le();
14867 __struct.v_acc = buf.get_u32_le();
14868 __struct.vel_acc = buf.get_u32_le();
14869 __struct.hdg_acc = buf.get_u32_le();
14870 Ok(__struct)
14871 }
14872 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14873 let mut __tmp = BytesMut::new(bytes);
14874 #[allow(clippy::absurd_extreme_comparisons)]
14875 #[allow(unused_comparisons)]
14876 if __tmp.remaining() < Self::ENCODED_LEN {
14877 panic!(
14878 "buffer is too small (need {} bytes, but got {})",
14879 Self::ENCODED_LEN,
14880 __tmp.remaining(),
14881 )
14882 }
14883 __tmp.put_u64_le(self.time_usec);
14884 __tmp.put_i32_le(self.lat);
14885 __tmp.put_i32_le(self.lon);
14886 __tmp.put_i32_le(self.alt);
14887 __tmp.put_u32_le(self.dgps_age);
14888 __tmp.put_u16_le(self.eph);
14889 __tmp.put_u16_le(self.epv);
14890 __tmp.put_u16_le(self.vel);
14891 __tmp.put_u16_le(self.cog);
14892 __tmp.put_u8(self.fix_type as u8);
14893 __tmp.put_u8(self.satellites_visible);
14894 __tmp.put_u8(self.dgps_numch);
14895 if matches!(version, MavlinkVersion::V2) {
14896 __tmp.put_u16_le(self.yaw);
14897 __tmp.put_i32_le(self.alt_ellipsoid);
14898 __tmp.put_u32_le(self.h_acc);
14899 __tmp.put_u32_le(self.v_acc);
14900 __tmp.put_u32_le(self.vel_acc);
14901 __tmp.put_u32_le(self.hdg_acc);
14902 let len = __tmp.len();
14903 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14904 } else {
14905 __tmp.len()
14906 }
14907 }
14908}
14909#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14910#[doc = ""]
14911#[doc = "ID: 128"]
14912#[derive(Debug, Clone, PartialEq)]
14913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14915#[cfg_attr(feature = "ts", derive(TS))]
14916#[cfg_attr(feature = "ts", ts(export))]
14917pub struct GPS2_RTK_DATA {
14918 #[doc = "Time since boot of last baseline message received."]
14919 pub time_last_baseline_ms: u32,
14920 #[doc = "GPS Time of Week of last baseline"]
14921 pub tow: u32,
14922 #[doc = "Current baseline in ECEF x or NED north component."]
14923 pub baseline_a_mm: i32,
14924 #[doc = "Current baseline in ECEF y or NED east component."]
14925 pub baseline_b_mm: i32,
14926 #[doc = "Current baseline in ECEF z or NED down component."]
14927 pub baseline_c_mm: i32,
14928 #[doc = "Current estimate of baseline accuracy."]
14929 pub accuracy: u32,
14930 #[doc = "Current number of integer ambiguity hypotheses."]
14931 pub iar_num_hypotheses: i32,
14932 #[doc = "GPS Week Number of last baseline"]
14933 pub wn: u16,
14934 #[doc = "Identification of connected RTK receiver."]
14935 pub rtk_receiver_id: u8,
14936 #[doc = "GPS-specific health report for RTK data."]
14937 pub rtk_health: u8,
14938 #[doc = "Rate of baseline messages being received by GPS"]
14939 pub rtk_rate: u8,
14940 #[doc = "Current number of sats used for RTK calculation."]
14941 pub nsats: u8,
14942 #[doc = "Coordinate system of baseline"]
14943 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14944}
14945impl GPS2_RTK_DATA {
14946 pub const ENCODED_LEN: usize = 35usize;
14947 pub const DEFAULT: Self = Self {
14948 time_last_baseline_ms: 0_u32,
14949 tow: 0_u32,
14950 baseline_a_mm: 0_i32,
14951 baseline_b_mm: 0_i32,
14952 baseline_c_mm: 0_i32,
14953 accuracy: 0_u32,
14954 iar_num_hypotheses: 0_i32,
14955 wn: 0_u16,
14956 rtk_receiver_id: 0_u8,
14957 rtk_health: 0_u8,
14958 rtk_rate: 0_u8,
14959 nsats: 0_u8,
14960 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14961 };
14962 #[cfg(feature = "arbitrary")]
14963 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14964 use arbitrary::{Arbitrary, Unstructured};
14965 let mut buf = [0u8; 1024];
14966 rng.fill_bytes(&mut buf);
14967 let mut unstructured = Unstructured::new(&buf);
14968 Self::arbitrary(&mut unstructured).unwrap_or_default()
14969 }
14970}
14971impl Default for GPS2_RTK_DATA {
14972 fn default() -> Self {
14973 Self::DEFAULT.clone()
14974 }
14975}
14976impl MessageData for GPS2_RTK_DATA {
14977 type Message = MavMessage;
14978 const ID: u32 = 128u32;
14979 const NAME: &'static str = "GPS2_RTK";
14980 const EXTRA_CRC: u8 = 226u8;
14981 const ENCODED_LEN: usize = 35usize;
14982 fn deser(
14983 _version: MavlinkVersion,
14984 __input: &[u8],
14985 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14986 let avail_len = __input.len();
14987 let mut payload_buf = [0; Self::ENCODED_LEN];
14988 let mut buf = if avail_len < Self::ENCODED_LEN {
14989 payload_buf[0..avail_len].copy_from_slice(__input);
14990 Bytes::new(&payload_buf)
14991 } else {
14992 Bytes::new(__input)
14993 };
14994 let mut __struct = Self::default();
14995 __struct.time_last_baseline_ms = buf.get_u32_le();
14996 __struct.tow = buf.get_u32_le();
14997 __struct.baseline_a_mm = buf.get_i32_le();
14998 __struct.baseline_b_mm = buf.get_i32_le();
14999 __struct.baseline_c_mm = buf.get_i32_le();
15000 __struct.accuracy = buf.get_u32_le();
15001 __struct.iar_num_hypotheses = buf.get_i32_le();
15002 __struct.wn = buf.get_u16_le();
15003 __struct.rtk_receiver_id = buf.get_u8();
15004 __struct.rtk_health = buf.get_u8();
15005 __struct.rtk_rate = buf.get_u8();
15006 __struct.nsats = buf.get_u8();
15007 let tmp = buf.get_u8();
15008 __struct.baseline_coords_type =
15009 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15010 enum_type: "RtkBaselineCoordinateSystem",
15011 value: tmp as u32,
15012 })?;
15013 Ok(__struct)
15014 }
15015 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15016 let mut __tmp = BytesMut::new(bytes);
15017 #[allow(clippy::absurd_extreme_comparisons)]
15018 #[allow(unused_comparisons)]
15019 if __tmp.remaining() < Self::ENCODED_LEN {
15020 panic!(
15021 "buffer is too small (need {} bytes, but got {})",
15022 Self::ENCODED_LEN,
15023 __tmp.remaining(),
15024 )
15025 }
15026 __tmp.put_u32_le(self.time_last_baseline_ms);
15027 __tmp.put_u32_le(self.tow);
15028 __tmp.put_i32_le(self.baseline_a_mm);
15029 __tmp.put_i32_le(self.baseline_b_mm);
15030 __tmp.put_i32_le(self.baseline_c_mm);
15031 __tmp.put_u32_le(self.accuracy);
15032 __tmp.put_i32_le(self.iar_num_hypotheses);
15033 __tmp.put_u16_le(self.wn);
15034 __tmp.put_u8(self.rtk_receiver_id);
15035 __tmp.put_u8(self.rtk_health);
15036 __tmp.put_u8(self.rtk_rate);
15037 __tmp.put_u8(self.nsats);
15038 __tmp.put_u8(self.baseline_coords_type as u8);
15039 if matches!(version, MavlinkVersion::V2) {
15040 let len = __tmp.len();
15041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15042 } else {
15043 __tmp.len()
15044 }
15045 }
15046}
15047#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
15048#[doc = ""]
15049#[doc = "ID: 49"]
15050#[derive(Debug, Clone, PartialEq)]
15051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15052#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15053#[cfg_attr(feature = "ts", derive(TS))]
15054#[cfg_attr(feature = "ts", ts(export))]
15055pub struct GPS_GLOBAL_ORIGIN_DATA {
15056 #[doc = "Latitude (WGS84)"]
15057 pub latitude: i32,
15058 #[doc = "Longitude (WGS84)"]
15059 pub longitude: i32,
15060 #[doc = "Altitude (MSL). Positive for up."]
15061 pub altitude: i32,
15062 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15063 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15064 pub time_usec: u64,
15065}
15066impl GPS_GLOBAL_ORIGIN_DATA {
15067 pub const ENCODED_LEN: usize = 20usize;
15068 pub const DEFAULT: Self = Self {
15069 latitude: 0_i32,
15070 longitude: 0_i32,
15071 altitude: 0_i32,
15072 time_usec: 0_u64,
15073 };
15074 #[cfg(feature = "arbitrary")]
15075 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15076 use arbitrary::{Arbitrary, Unstructured};
15077 let mut buf = [0u8; 1024];
15078 rng.fill_bytes(&mut buf);
15079 let mut unstructured = Unstructured::new(&buf);
15080 Self::arbitrary(&mut unstructured).unwrap_or_default()
15081 }
15082}
15083impl Default for GPS_GLOBAL_ORIGIN_DATA {
15084 fn default() -> Self {
15085 Self::DEFAULT.clone()
15086 }
15087}
15088impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
15089 type Message = MavMessage;
15090 const ID: u32 = 49u32;
15091 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
15092 const EXTRA_CRC: u8 = 39u8;
15093 const ENCODED_LEN: usize = 20usize;
15094 fn deser(
15095 _version: MavlinkVersion,
15096 __input: &[u8],
15097 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15098 let avail_len = __input.len();
15099 let mut payload_buf = [0; Self::ENCODED_LEN];
15100 let mut buf = if avail_len < Self::ENCODED_LEN {
15101 payload_buf[0..avail_len].copy_from_slice(__input);
15102 Bytes::new(&payload_buf)
15103 } else {
15104 Bytes::new(__input)
15105 };
15106 let mut __struct = Self::default();
15107 __struct.latitude = buf.get_i32_le();
15108 __struct.longitude = buf.get_i32_le();
15109 __struct.altitude = buf.get_i32_le();
15110 __struct.time_usec = buf.get_u64_le();
15111 Ok(__struct)
15112 }
15113 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15114 let mut __tmp = BytesMut::new(bytes);
15115 #[allow(clippy::absurd_extreme_comparisons)]
15116 #[allow(unused_comparisons)]
15117 if __tmp.remaining() < Self::ENCODED_LEN {
15118 panic!(
15119 "buffer is too small (need {} bytes, but got {})",
15120 Self::ENCODED_LEN,
15121 __tmp.remaining(),
15122 )
15123 }
15124 __tmp.put_i32_le(self.latitude);
15125 __tmp.put_i32_le(self.longitude);
15126 __tmp.put_i32_le(self.altitude);
15127 if matches!(version, MavlinkVersion::V2) {
15128 __tmp.put_u64_le(self.time_usec);
15129 let len = __tmp.len();
15130 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15131 } else {
15132 __tmp.len()
15133 }
15134 }
15135}
15136#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
15137#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
15138#[doc = ""]
15139#[doc = "ID: 123"]
15140#[derive(Debug, Clone, PartialEq)]
15141#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15142#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15143#[cfg_attr(feature = "ts", derive(TS))]
15144#[cfg_attr(feature = "ts", ts(export))]
15145pub struct GPS_INJECT_DATA_DATA {
15146 #[doc = "System ID"]
15147 pub target_system: u8,
15148 #[doc = "Component ID"]
15149 pub target_component: u8,
15150 #[doc = "Data length"]
15151 pub len: u8,
15152 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
15153 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15154 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15155 pub data: [u8; 110],
15156}
15157impl GPS_INJECT_DATA_DATA {
15158 pub const ENCODED_LEN: usize = 113usize;
15159 pub const DEFAULT: Self = Self {
15160 target_system: 0_u8,
15161 target_component: 0_u8,
15162 len: 0_u8,
15163 data: [0_u8; 110usize],
15164 };
15165 #[cfg(feature = "arbitrary")]
15166 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15167 use arbitrary::{Arbitrary, Unstructured};
15168 let mut buf = [0u8; 1024];
15169 rng.fill_bytes(&mut buf);
15170 let mut unstructured = Unstructured::new(&buf);
15171 Self::arbitrary(&mut unstructured).unwrap_or_default()
15172 }
15173}
15174impl Default for GPS_INJECT_DATA_DATA {
15175 fn default() -> Self {
15176 Self::DEFAULT.clone()
15177 }
15178}
15179impl MessageData for GPS_INJECT_DATA_DATA {
15180 type Message = MavMessage;
15181 const ID: u32 = 123u32;
15182 const NAME: &'static str = "GPS_INJECT_DATA";
15183 const EXTRA_CRC: u8 = 250u8;
15184 const ENCODED_LEN: usize = 113usize;
15185 fn deser(
15186 _version: MavlinkVersion,
15187 __input: &[u8],
15188 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15189 let avail_len = __input.len();
15190 let mut payload_buf = [0; Self::ENCODED_LEN];
15191 let mut buf = if avail_len < Self::ENCODED_LEN {
15192 payload_buf[0..avail_len].copy_from_slice(__input);
15193 Bytes::new(&payload_buf)
15194 } else {
15195 Bytes::new(__input)
15196 };
15197 let mut __struct = Self::default();
15198 __struct.target_system = buf.get_u8();
15199 __struct.target_component = buf.get_u8();
15200 __struct.len = buf.get_u8();
15201 for v in &mut __struct.data {
15202 let val = buf.get_u8();
15203 *v = val;
15204 }
15205 Ok(__struct)
15206 }
15207 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15208 let mut __tmp = BytesMut::new(bytes);
15209 #[allow(clippy::absurd_extreme_comparisons)]
15210 #[allow(unused_comparisons)]
15211 if __tmp.remaining() < Self::ENCODED_LEN {
15212 panic!(
15213 "buffer is too small (need {} bytes, but got {})",
15214 Self::ENCODED_LEN,
15215 __tmp.remaining(),
15216 )
15217 }
15218 __tmp.put_u8(self.target_system);
15219 __tmp.put_u8(self.target_component);
15220 __tmp.put_u8(self.len);
15221 for val in &self.data {
15222 __tmp.put_u8(*val);
15223 }
15224 if matches!(version, MavlinkVersion::V2) {
15225 let len = __tmp.len();
15226 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15227 } else {
15228 __tmp.len()
15229 }
15230 }
15231}
15232#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
15233#[doc = ""]
15234#[doc = "ID: 232"]
15235#[derive(Debug, Clone, PartialEq)]
15236#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15237#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15238#[cfg_attr(feature = "ts", derive(TS))]
15239#[cfg_attr(feature = "ts", ts(export))]
15240pub struct GPS_INPUT_DATA {
15241 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15242 pub time_usec: u64,
15243 #[doc = "GPS time (from start of GPS week)"]
15244 pub time_week_ms: u32,
15245 #[doc = "Latitude (WGS84)"]
15246 pub lat: i32,
15247 #[doc = "Longitude (WGS84)"]
15248 pub lon: i32,
15249 #[doc = "Altitude (MSL). Positive for up."]
15250 pub alt: f32,
15251 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
15252 pub hdop: f32,
15253 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
15254 pub vdop: f32,
15255 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15256 pub vn: f32,
15257 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15258 pub ve: f32,
15259 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15260 pub vd: f32,
15261 #[doc = "GPS speed accuracy"]
15262 pub speed_accuracy: f32,
15263 #[doc = "GPS horizontal accuracy"]
15264 pub horiz_accuracy: f32,
15265 #[doc = "GPS vertical accuracy"]
15266 pub vert_accuracy: f32,
15267 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
15268 pub ignore_flags: GpsInputIgnoreFlags,
15269 #[doc = "GPS week number"]
15270 pub time_week: u16,
15271 #[doc = "ID of the GPS for multiple GPS inputs"]
15272 pub gps_id: u8,
15273 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
15274 pub fix_type: u8,
15275 #[doc = "Number of satellites visible."]
15276 pub satellites_visible: u8,
15277 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15278 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15279 pub yaw: u16,
15280}
15281impl GPS_INPUT_DATA {
15282 pub const ENCODED_LEN: usize = 65usize;
15283 pub const DEFAULT: Self = Self {
15284 time_usec: 0_u64,
15285 time_week_ms: 0_u32,
15286 lat: 0_i32,
15287 lon: 0_i32,
15288 alt: 0.0_f32,
15289 hdop: 0.0_f32,
15290 vdop: 0.0_f32,
15291 vn: 0.0_f32,
15292 ve: 0.0_f32,
15293 vd: 0.0_f32,
15294 speed_accuracy: 0.0_f32,
15295 horiz_accuracy: 0.0_f32,
15296 vert_accuracy: 0.0_f32,
15297 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
15298 time_week: 0_u16,
15299 gps_id: 0_u8,
15300 fix_type: 0_u8,
15301 satellites_visible: 0_u8,
15302 yaw: 0_u16,
15303 };
15304 #[cfg(feature = "arbitrary")]
15305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15306 use arbitrary::{Arbitrary, Unstructured};
15307 let mut buf = [0u8; 1024];
15308 rng.fill_bytes(&mut buf);
15309 let mut unstructured = Unstructured::new(&buf);
15310 Self::arbitrary(&mut unstructured).unwrap_or_default()
15311 }
15312}
15313impl Default for GPS_INPUT_DATA {
15314 fn default() -> Self {
15315 Self::DEFAULT.clone()
15316 }
15317}
15318impl MessageData for GPS_INPUT_DATA {
15319 type Message = MavMessage;
15320 const ID: u32 = 232u32;
15321 const NAME: &'static str = "GPS_INPUT";
15322 const EXTRA_CRC: u8 = 151u8;
15323 const ENCODED_LEN: usize = 65usize;
15324 fn deser(
15325 _version: MavlinkVersion,
15326 __input: &[u8],
15327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15328 let avail_len = __input.len();
15329 let mut payload_buf = [0; Self::ENCODED_LEN];
15330 let mut buf = if avail_len < Self::ENCODED_LEN {
15331 payload_buf[0..avail_len].copy_from_slice(__input);
15332 Bytes::new(&payload_buf)
15333 } else {
15334 Bytes::new(__input)
15335 };
15336 let mut __struct = Self::default();
15337 __struct.time_usec = buf.get_u64_le();
15338 __struct.time_week_ms = buf.get_u32_le();
15339 __struct.lat = buf.get_i32_le();
15340 __struct.lon = buf.get_i32_le();
15341 __struct.alt = buf.get_f32_le();
15342 __struct.hdop = buf.get_f32_le();
15343 __struct.vdop = buf.get_f32_le();
15344 __struct.vn = buf.get_f32_le();
15345 __struct.ve = buf.get_f32_le();
15346 __struct.vd = buf.get_f32_le();
15347 __struct.speed_accuracy = buf.get_f32_le();
15348 __struct.horiz_accuracy = buf.get_f32_le();
15349 __struct.vert_accuracy = buf.get_f32_le();
15350 let tmp = buf.get_u16_le();
15351 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
15352 tmp & GpsInputIgnoreFlags::all().bits(),
15353 )
15354 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15355 flag_type: "GpsInputIgnoreFlags",
15356 value: tmp as u32,
15357 })?;
15358 __struct.time_week = buf.get_u16_le();
15359 __struct.gps_id = buf.get_u8();
15360 __struct.fix_type = buf.get_u8();
15361 __struct.satellites_visible = buf.get_u8();
15362 __struct.yaw = buf.get_u16_le();
15363 Ok(__struct)
15364 }
15365 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15366 let mut __tmp = BytesMut::new(bytes);
15367 #[allow(clippy::absurd_extreme_comparisons)]
15368 #[allow(unused_comparisons)]
15369 if __tmp.remaining() < Self::ENCODED_LEN {
15370 panic!(
15371 "buffer is too small (need {} bytes, but got {})",
15372 Self::ENCODED_LEN,
15373 __tmp.remaining(),
15374 )
15375 }
15376 __tmp.put_u64_le(self.time_usec);
15377 __tmp.put_u32_le(self.time_week_ms);
15378 __tmp.put_i32_le(self.lat);
15379 __tmp.put_i32_le(self.lon);
15380 __tmp.put_f32_le(self.alt);
15381 __tmp.put_f32_le(self.hdop);
15382 __tmp.put_f32_le(self.vdop);
15383 __tmp.put_f32_le(self.vn);
15384 __tmp.put_f32_le(self.ve);
15385 __tmp.put_f32_le(self.vd);
15386 __tmp.put_f32_le(self.speed_accuracy);
15387 __tmp.put_f32_le(self.horiz_accuracy);
15388 __tmp.put_f32_le(self.vert_accuracy);
15389 __tmp.put_u16_le(self.ignore_flags.bits());
15390 __tmp.put_u16_le(self.time_week);
15391 __tmp.put_u8(self.gps_id);
15392 __tmp.put_u8(self.fix_type);
15393 __tmp.put_u8(self.satellites_visible);
15394 if matches!(version, MavlinkVersion::V2) {
15395 __tmp.put_u16_le(self.yaw);
15396 let len = __tmp.len();
15397 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15398 } else {
15399 __tmp.len()
15400 }
15401 }
15402}
15403#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15404#[doc = ""]
15405#[doc = "ID: 24"]
15406#[derive(Debug, Clone, PartialEq)]
15407#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15408#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15409#[cfg_attr(feature = "ts", derive(TS))]
15410#[cfg_attr(feature = "ts", ts(export))]
15411pub struct GPS_RAW_INT_DATA {
15412 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15413 pub time_usec: u64,
15414 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
15415 pub lat: i32,
15416 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
15417 pub lon: i32,
15418 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
15419 pub alt: i32,
15420 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15421 pub eph: u16,
15422 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15423 pub epv: u16,
15424 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15425 pub vel: u16,
15426 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15427 pub cog: u16,
15428 #[doc = "GPS fix type."]
15429 pub fix_type: GpsFixType,
15430 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15431 pub satellites_visible: u8,
15432 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
15433 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15434 pub alt_ellipsoid: i32,
15435 #[doc = "Position uncertainty."]
15436 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15437 pub h_acc: u32,
15438 #[doc = "Altitude uncertainty."]
15439 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15440 pub v_acc: u32,
15441 #[doc = "Speed uncertainty."]
15442 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15443 pub vel_acc: u32,
15444 #[doc = "Heading / track uncertainty"]
15445 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15446 pub hdg_acc: u32,
15447 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
15448 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15449 pub yaw: u16,
15450}
15451impl GPS_RAW_INT_DATA {
15452 pub const ENCODED_LEN: usize = 52usize;
15453 pub const DEFAULT: Self = Self {
15454 time_usec: 0_u64,
15455 lat: 0_i32,
15456 lon: 0_i32,
15457 alt: 0_i32,
15458 eph: 0_u16,
15459 epv: 0_u16,
15460 vel: 0_u16,
15461 cog: 0_u16,
15462 fix_type: GpsFixType::DEFAULT,
15463 satellites_visible: 0_u8,
15464 alt_ellipsoid: 0_i32,
15465 h_acc: 0_u32,
15466 v_acc: 0_u32,
15467 vel_acc: 0_u32,
15468 hdg_acc: 0_u32,
15469 yaw: 0_u16,
15470 };
15471 #[cfg(feature = "arbitrary")]
15472 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15473 use arbitrary::{Arbitrary, Unstructured};
15474 let mut buf = [0u8; 1024];
15475 rng.fill_bytes(&mut buf);
15476 let mut unstructured = Unstructured::new(&buf);
15477 Self::arbitrary(&mut unstructured).unwrap_or_default()
15478 }
15479}
15480impl Default for GPS_RAW_INT_DATA {
15481 fn default() -> Self {
15482 Self::DEFAULT.clone()
15483 }
15484}
15485impl MessageData for GPS_RAW_INT_DATA {
15486 type Message = MavMessage;
15487 const ID: u32 = 24u32;
15488 const NAME: &'static str = "GPS_RAW_INT";
15489 const EXTRA_CRC: u8 = 24u8;
15490 const ENCODED_LEN: usize = 52usize;
15491 fn deser(
15492 _version: MavlinkVersion,
15493 __input: &[u8],
15494 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15495 let avail_len = __input.len();
15496 let mut payload_buf = [0; Self::ENCODED_LEN];
15497 let mut buf = if avail_len < Self::ENCODED_LEN {
15498 payload_buf[0..avail_len].copy_from_slice(__input);
15499 Bytes::new(&payload_buf)
15500 } else {
15501 Bytes::new(__input)
15502 };
15503 let mut __struct = Self::default();
15504 __struct.time_usec = buf.get_u64_le();
15505 __struct.lat = buf.get_i32_le();
15506 __struct.lon = buf.get_i32_le();
15507 __struct.alt = buf.get_i32_le();
15508 __struct.eph = buf.get_u16_le();
15509 __struct.epv = buf.get_u16_le();
15510 __struct.vel = buf.get_u16_le();
15511 __struct.cog = buf.get_u16_le();
15512 let tmp = buf.get_u8();
15513 __struct.fix_type =
15514 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15515 enum_type: "GpsFixType",
15516 value: tmp as u32,
15517 })?;
15518 __struct.satellites_visible = buf.get_u8();
15519 __struct.alt_ellipsoid = buf.get_i32_le();
15520 __struct.h_acc = buf.get_u32_le();
15521 __struct.v_acc = buf.get_u32_le();
15522 __struct.vel_acc = buf.get_u32_le();
15523 __struct.hdg_acc = buf.get_u32_le();
15524 __struct.yaw = buf.get_u16_le();
15525 Ok(__struct)
15526 }
15527 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15528 let mut __tmp = BytesMut::new(bytes);
15529 #[allow(clippy::absurd_extreme_comparisons)]
15530 #[allow(unused_comparisons)]
15531 if __tmp.remaining() < Self::ENCODED_LEN {
15532 panic!(
15533 "buffer is too small (need {} bytes, but got {})",
15534 Self::ENCODED_LEN,
15535 __tmp.remaining(),
15536 )
15537 }
15538 __tmp.put_u64_le(self.time_usec);
15539 __tmp.put_i32_le(self.lat);
15540 __tmp.put_i32_le(self.lon);
15541 __tmp.put_i32_le(self.alt);
15542 __tmp.put_u16_le(self.eph);
15543 __tmp.put_u16_le(self.epv);
15544 __tmp.put_u16_le(self.vel);
15545 __tmp.put_u16_le(self.cog);
15546 __tmp.put_u8(self.fix_type as u8);
15547 __tmp.put_u8(self.satellites_visible);
15548 if matches!(version, MavlinkVersion::V2) {
15549 __tmp.put_i32_le(self.alt_ellipsoid);
15550 __tmp.put_u32_le(self.h_acc);
15551 __tmp.put_u32_le(self.v_acc);
15552 __tmp.put_u32_le(self.vel_acc);
15553 __tmp.put_u32_le(self.hdg_acc);
15554 __tmp.put_u16_le(self.yaw);
15555 let len = __tmp.len();
15556 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15557 } else {
15558 __tmp.len()
15559 }
15560 }
15561}
15562#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
15563#[doc = ""]
15564#[doc = "ID: 233"]
15565#[derive(Debug, Clone, PartialEq)]
15566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15567#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15568#[cfg_attr(feature = "ts", derive(TS))]
15569#[cfg_attr(feature = "ts", ts(export))]
15570pub struct GPS_RTCM_DATA_DATA {
15571 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
15572 pub flags: u8,
15573 #[doc = "data length"]
15574 pub len: u8,
15575 #[doc = "RTCM message (may be fragmented)"]
15576 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15577 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15578 pub data: [u8; 180],
15579}
15580impl GPS_RTCM_DATA_DATA {
15581 pub const ENCODED_LEN: usize = 182usize;
15582 pub const DEFAULT: Self = Self {
15583 flags: 0_u8,
15584 len: 0_u8,
15585 data: [0_u8; 180usize],
15586 };
15587 #[cfg(feature = "arbitrary")]
15588 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15589 use arbitrary::{Arbitrary, Unstructured};
15590 let mut buf = [0u8; 1024];
15591 rng.fill_bytes(&mut buf);
15592 let mut unstructured = Unstructured::new(&buf);
15593 Self::arbitrary(&mut unstructured).unwrap_or_default()
15594 }
15595}
15596impl Default for GPS_RTCM_DATA_DATA {
15597 fn default() -> Self {
15598 Self::DEFAULT.clone()
15599 }
15600}
15601impl MessageData for GPS_RTCM_DATA_DATA {
15602 type Message = MavMessage;
15603 const ID: u32 = 233u32;
15604 const NAME: &'static str = "GPS_RTCM_DATA";
15605 const EXTRA_CRC: u8 = 35u8;
15606 const ENCODED_LEN: usize = 182usize;
15607 fn deser(
15608 _version: MavlinkVersion,
15609 __input: &[u8],
15610 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15611 let avail_len = __input.len();
15612 let mut payload_buf = [0; Self::ENCODED_LEN];
15613 let mut buf = if avail_len < Self::ENCODED_LEN {
15614 payload_buf[0..avail_len].copy_from_slice(__input);
15615 Bytes::new(&payload_buf)
15616 } else {
15617 Bytes::new(__input)
15618 };
15619 let mut __struct = Self::default();
15620 __struct.flags = buf.get_u8();
15621 __struct.len = buf.get_u8();
15622 for v in &mut __struct.data {
15623 let val = buf.get_u8();
15624 *v = val;
15625 }
15626 Ok(__struct)
15627 }
15628 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15629 let mut __tmp = BytesMut::new(bytes);
15630 #[allow(clippy::absurd_extreme_comparisons)]
15631 #[allow(unused_comparisons)]
15632 if __tmp.remaining() < Self::ENCODED_LEN {
15633 panic!(
15634 "buffer is too small (need {} bytes, but got {})",
15635 Self::ENCODED_LEN,
15636 __tmp.remaining(),
15637 )
15638 }
15639 __tmp.put_u8(self.flags);
15640 __tmp.put_u8(self.len);
15641 for val in &self.data {
15642 __tmp.put_u8(*val);
15643 }
15644 if matches!(version, MavlinkVersion::V2) {
15645 let len = __tmp.len();
15646 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15647 } else {
15648 __tmp.len()
15649 }
15650 }
15651}
15652#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
15653#[doc = ""]
15654#[doc = "ID: 127"]
15655#[derive(Debug, Clone, PartialEq)]
15656#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15657#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15658#[cfg_attr(feature = "ts", derive(TS))]
15659#[cfg_attr(feature = "ts", ts(export))]
15660pub struct GPS_RTK_DATA {
15661 #[doc = "Time since boot of last baseline message received."]
15662 pub time_last_baseline_ms: u32,
15663 #[doc = "GPS Time of Week of last baseline"]
15664 pub tow: u32,
15665 #[doc = "Current baseline in ECEF x or NED north component."]
15666 pub baseline_a_mm: i32,
15667 #[doc = "Current baseline in ECEF y or NED east component."]
15668 pub baseline_b_mm: i32,
15669 #[doc = "Current baseline in ECEF z or NED down component."]
15670 pub baseline_c_mm: i32,
15671 #[doc = "Current estimate of baseline accuracy."]
15672 pub accuracy: u32,
15673 #[doc = "Current number of integer ambiguity hypotheses."]
15674 pub iar_num_hypotheses: i32,
15675 #[doc = "GPS Week Number of last baseline"]
15676 pub wn: u16,
15677 #[doc = "Identification of connected RTK receiver."]
15678 pub rtk_receiver_id: u8,
15679 #[doc = "GPS-specific health report for RTK data."]
15680 pub rtk_health: u8,
15681 #[doc = "Rate of baseline messages being received by GPS"]
15682 pub rtk_rate: u8,
15683 #[doc = "Current number of sats used for RTK calculation."]
15684 pub nsats: u8,
15685 #[doc = "Coordinate system of baseline"]
15686 pub baseline_coords_type: RtkBaselineCoordinateSystem,
15687}
15688impl GPS_RTK_DATA {
15689 pub const ENCODED_LEN: usize = 35usize;
15690 pub const DEFAULT: Self = Self {
15691 time_last_baseline_ms: 0_u32,
15692 tow: 0_u32,
15693 baseline_a_mm: 0_i32,
15694 baseline_b_mm: 0_i32,
15695 baseline_c_mm: 0_i32,
15696 accuracy: 0_u32,
15697 iar_num_hypotheses: 0_i32,
15698 wn: 0_u16,
15699 rtk_receiver_id: 0_u8,
15700 rtk_health: 0_u8,
15701 rtk_rate: 0_u8,
15702 nsats: 0_u8,
15703 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
15704 };
15705 #[cfg(feature = "arbitrary")]
15706 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15707 use arbitrary::{Arbitrary, Unstructured};
15708 let mut buf = [0u8; 1024];
15709 rng.fill_bytes(&mut buf);
15710 let mut unstructured = Unstructured::new(&buf);
15711 Self::arbitrary(&mut unstructured).unwrap_or_default()
15712 }
15713}
15714impl Default for GPS_RTK_DATA {
15715 fn default() -> Self {
15716 Self::DEFAULT.clone()
15717 }
15718}
15719impl MessageData for GPS_RTK_DATA {
15720 type Message = MavMessage;
15721 const ID: u32 = 127u32;
15722 const NAME: &'static str = "GPS_RTK";
15723 const EXTRA_CRC: u8 = 25u8;
15724 const ENCODED_LEN: usize = 35usize;
15725 fn deser(
15726 _version: MavlinkVersion,
15727 __input: &[u8],
15728 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15729 let avail_len = __input.len();
15730 let mut payload_buf = [0; Self::ENCODED_LEN];
15731 let mut buf = if avail_len < Self::ENCODED_LEN {
15732 payload_buf[0..avail_len].copy_from_slice(__input);
15733 Bytes::new(&payload_buf)
15734 } else {
15735 Bytes::new(__input)
15736 };
15737 let mut __struct = Self::default();
15738 __struct.time_last_baseline_ms = buf.get_u32_le();
15739 __struct.tow = buf.get_u32_le();
15740 __struct.baseline_a_mm = buf.get_i32_le();
15741 __struct.baseline_b_mm = buf.get_i32_le();
15742 __struct.baseline_c_mm = buf.get_i32_le();
15743 __struct.accuracy = buf.get_u32_le();
15744 __struct.iar_num_hypotheses = buf.get_i32_le();
15745 __struct.wn = buf.get_u16_le();
15746 __struct.rtk_receiver_id = buf.get_u8();
15747 __struct.rtk_health = buf.get_u8();
15748 __struct.rtk_rate = buf.get_u8();
15749 __struct.nsats = buf.get_u8();
15750 let tmp = buf.get_u8();
15751 __struct.baseline_coords_type =
15752 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15753 enum_type: "RtkBaselineCoordinateSystem",
15754 value: tmp as u32,
15755 })?;
15756 Ok(__struct)
15757 }
15758 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15759 let mut __tmp = BytesMut::new(bytes);
15760 #[allow(clippy::absurd_extreme_comparisons)]
15761 #[allow(unused_comparisons)]
15762 if __tmp.remaining() < Self::ENCODED_LEN {
15763 panic!(
15764 "buffer is too small (need {} bytes, but got {})",
15765 Self::ENCODED_LEN,
15766 __tmp.remaining(),
15767 )
15768 }
15769 __tmp.put_u32_le(self.time_last_baseline_ms);
15770 __tmp.put_u32_le(self.tow);
15771 __tmp.put_i32_le(self.baseline_a_mm);
15772 __tmp.put_i32_le(self.baseline_b_mm);
15773 __tmp.put_i32_le(self.baseline_c_mm);
15774 __tmp.put_u32_le(self.accuracy);
15775 __tmp.put_i32_le(self.iar_num_hypotheses);
15776 __tmp.put_u16_le(self.wn);
15777 __tmp.put_u8(self.rtk_receiver_id);
15778 __tmp.put_u8(self.rtk_health);
15779 __tmp.put_u8(self.rtk_rate);
15780 __tmp.put_u8(self.nsats);
15781 __tmp.put_u8(self.baseline_coords_type as u8);
15782 if matches!(version, MavlinkVersion::V2) {
15783 let len = __tmp.len();
15784 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15785 } else {
15786 __tmp.len()
15787 }
15788 }
15789}
15790#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
15791#[doc = ""]
15792#[doc = "ID: 25"]
15793#[derive(Debug, Clone, PartialEq)]
15794#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15796#[cfg_attr(feature = "ts", derive(TS))]
15797#[cfg_attr(feature = "ts", ts(export))]
15798pub struct GPS_STATUS_DATA {
15799 #[doc = "Number of satellites visible"]
15800 pub satellites_visible: u8,
15801 #[doc = "Global satellite ID"]
15802 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15803 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15804 pub satellite_prn: [u8; 20],
15805 #[doc = "0: Satellite not used, 1: used for localization"]
15806 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15807 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15808 pub satellite_used: [u8; 20],
15809 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
15810 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15811 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15812 pub satellite_elevation: [u8; 20],
15813 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
15814 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15815 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15816 pub satellite_azimuth: [u8; 20],
15817 #[doc = "Signal to noise ratio of satellite"]
15818 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15819 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15820 pub satellite_snr: [u8; 20],
15821}
15822impl GPS_STATUS_DATA {
15823 pub const ENCODED_LEN: usize = 101usize;
15824 pub const DEFAULT: Self = Self {
15825 satellites_visible: 0_u8,
15826 satellite_prn: [0_u8; 20usize],
15827 satellite_used: [0_u8; 20usize],
15828 satellite_elevation: [0_u8; 20usize],
15829 satellite_azimuth: [0_u8; 20usize],
15830 satellite_snr: [0_u8; 20usize],
15831 };
15832 #[cfg(feature = "arbitrary")]
15833 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15834 use arbitrary::{Arbitrary, Unstructured};
15835 let mut buf = [0u8; 1024];
15836 rng.fill_bytes(&mut buf);
15837 let mut unstructured = Unstructured::new(&buf);
15838 Self::arbitrary(&mut unstructured).unwrap_or_default()
15839 }
15840}
15841impl Default for GPS_STATUS_DATA {
15842 fn default() -> Self {
15843 Self::DEFAULT.clone()
15844 }
15845}
15846impl MessageData for GPS_STATUS_DATA {
15847 type Message = MavMessage;
15848 const ID: u32 = 25u32;
15849 const NAME: &'static str = "GPS_STATUS";
15850 const EXTRA_CRC: u8 = 23u8;
15851 const ENCODED_LEN: usize = 101usize;
15852 fn deser(
15853 _version: MavlinkVersion,
15854 __input: &[u8],
15855 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15856 let avail_len = __input.len();
15857 let mut payload_buf = [0; Self::ENCODED_LEN];
15858 let mut buf = if avail_len < Self::ENCODED_LEN {
15859 payload_buf[0..avail_len].copy_from_slice(__input);
15860 Bytes::new(&payload_buf)
15861 } else {
15862 Bytes::new(__input)
15863 };
15864 let mut __struct = Self::default();
15865 __struct.satellites_visible = buf.get_u8();
15866 for v in &mut __struct.satellite_prn {
15867 let val = buf.get_u8();
15868 *v = val;
15869 }
15870 for v in &mut __struct.satellite_used {
15871 let val = buf.get_u8();
15872 *v = val;
15873 }
15874 for v in &mut __struct.satellite_elevation {
15875 let val = buf.get_u8();
15876 *v = val;
15877 }
15878 for v in &mut __struct.satellite_azimuth {
15879 let val = buf.get_u8();
15880 *v = val;
15881 }
15882 for v in &mut __struct.satellite_snr {
15883 let val = buf.get_u8();
15884 *v = val;
15885 }
15886 Ok(__struct)
15887 }
15888 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15889 let mut __tmp = BytesMut::new(bytes);
15890 #[allow(clippy::absurd_extreme_comparisons)]
15891 #[allow(unused_comparisons)]
15892 if __tmp.remaining() < Self::ENCODED_LEN {
15893 panic!(
15894 "buffer is too small (need {} bytes, but got {})",
15895 Self::ENCODED_LEN,
15896 __tmp.remaining(),
15897 )
15898 }
15899 __tmp.put_u8(self.satellites_visible);
15900 for val in &self.satellite_prn {
15901 __tmp.put_u8(*val);
15902 }
15903 for val in &self.satellite_used {
15904 __tmp.put_u8(*val);
15905 }
15906 for val in &self.satellite_elevation {
15907 __tmp.put_u8(*val);
15908 }
15909 for val in &self.satellite_azimuth {
15910 __tmp.put_u8(*val);
15911 }
15912 for val in &self.satellite_snr {
15913 __tmp.put_u8(*val);
15914 }
15915 if matches!(version, MavlinkVersion::V2) {
15916 let len = __tmp.len();
15917 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15918 } else {
15919 __tmp.len()
15920 }
15921 }
15922}
15923#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
15924#[doc = ""]
15925#[doc = "ID: 0"]
15926#[derive(Debug, Clone, PartialEq)]
15927#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15928#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15929#[cfg_attr(feature = "ts", derive(TS))]
15930#[cfg_attr(feature = "ts", ts(export))]
15931pub struct HEARTBEAT_DATA {
15932 #[doc = "A bitfield for use for autopilot-specific flags"]
15933 pub custom_mode: u32,
15934 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
15935 pub mavtype: MavType,
15936 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15937 pub autopilot: MavAutopilot,
15938 #[doc = "System mode bitmap."]
15939 pub base_mode: MavModeFlag,
15940 #[doc = "System status flag."]
15941 pub system_status: MavState,
15942 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
15943 pub mavlink_version: u8,
15944}
15945impl HEARTBEAT_DATA {
15946 pub const ENCODED_LEN: usize = 9usize;
15947 pub const DEFAULT: Self = Self {
15948 custom_mode: 0_u32,
15949 mavtype: MavType::DEFAULT,
15950 autopilot: MavAutopilot::DEFAULT,
15951 base_mode: MavModeFlag::DEFAULT,
15952 system_status: MavState::DEFAULT,
15953 mavlink_version: MINOR_MAVLINK_VERSION,
15954 };
15955 #[cfg(feature = "arbitrary")]
15956 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15957 use arbitrary::{Arbitrary, Unstructured};
15958 let mut buf = [0u8; 1024];
15959 rng.fill_bytes(&mut buf);
15960 let mut unstructured = Unstructured::new(&buf);
15961 Self::arbitrary(&mut unstructured).unwrap_or_default()
15962 }
15963}
15964impl Default for HEARTBEAT_DATA {
15965 fn default() -> Self {
15966 Self::DEFAULT.clone()
15967 }
15968}
15969impl MessageData for HEARTBEAT_DATA {
15970 type Message = MavMessage;
15971 const ID: u32 = 0u32;
15972 const NAME: &'static str = "HEARTBEAT";
15973 const EXTRA_CRC: u8 = 50u8;
15974 const ENCODED_LEN: usize = 9usize;
15975 fn deser(
15976 _version: MavlinkVersion,
15977 __input: &[u8],
15978 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15979 let avail_len = __input.len();
15980 let mut payload_buf = [0; Self::ENCODED_LEN];
15981 let mut buf = if avail_len < Self::ENCODED_LEN {
15982 payload_buf[0..avail_len].copy_from_slice(__input);
15983 Bytes::new(&payload_buf)
15984 } else {
15985 Bytes::new(__input)
15986 };
15987 let mut __struct = Self::default();
15988 __struct.custom_mode = buf.get_u32_le();
15989 let tmp = buf.get_u8();
15990 __struct.mavtype =
15991 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15992 enum_type: "MavType",
15993 value: tmp as u32,
15994 })?;
15995 let tmp = buf.get_u8();
15996 __struct.autopilot =
15997 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15998 enum_type: "MavAutopilot",
15999 value: tmp as u32,
16000 })?;
16001 let tmp = buf.get_u8();
16002 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
16003 ::mavlink_core::error::ParserError::InvalidFlag {
16004 flag_type: "MavModeFlag",
16005 value: tmp as u32,
16006 },
16007 )?;
16008 let tmp = buf.get_u8();
16009 __struct.system_status =
16010 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16011 enum_type: "MavState",
16012 value: tmp as u32,
16013 })?;
16014 __struct.mavlink_version = buf.get_u8();
16015 Ok(__struct)
16016 }
16017 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16018 let mut __tmp = BytesMut::new(bytes);
16019 #[allow(clippy::absurd_extreme_comparisons)]
16020 #[allow(unused_comparisons)]
16021 if __tmp.remaining() < Self::ENCODED_LEN {
16022 panic!(
16023 "buffer is too small (need {} bytes, but got {})",
16024 Self::ENCODED_LEN,
16025 __tmp.remaining(),
16026 )
16027 }
16028 __tmp.put_u32_le(self.custom_mode);
16029 __tmp.put_u8(self.mavtype as u8);
16030 __tmp.put_u8(self.autopilot as u8);
16031 __tmp.put_u8(self.base_mode.bits());
16032 __tmp.put_u8(self.system_status as u8);
16033 __tmp.put_u8(self.mavlink_version);
16034 if matches!(version, MavlinkVersion::V2) {
16035 let len = __tmp.len();
16036 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16037 } else {
16038 __tmp.len()
16039 }
16040 }
16041}
16042#[doc = "The IMU readings in SI units in NED body frame."]
16043#[doc = ""]
16044#[doc = "ID: 105"]
16045#[derive(Debug, Clone, PartialEq)]
16046#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16047#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16048#[cfg_attr(feature = "ts", derive(TS))]
16049#[cfg_attr(feature = "ts", ts(export))]
16050pub struct HIGHRES_IMU_DATA {
16051 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16052 pub time_usec: u64,
16053 #[doc = "X acceleration"]
16054 pub xacc: f32,
16055 #[doc = "Y acceleration"]
16056 pub yacc: f32,
16057 #[doc = "Z acceleration"]
16058 pub zacc: f32,
16059 #[doc = "Angular speed around X axis"]
16060 pub xgyro: f32,
16061 #[doc = "Angular speed around Y axis"]
16062 pub ygyro: f32,
16063 #[doc = "Angular speed around Z axis"]
16064 pub zgyro: f32,
16065 #[doc = "X Magnetic field"]
16066 pub xmag: f32,
16067 #[doc = "Y Magnetic field"]
16068 pub ymag: f32,
16069 #[doc = "Z Magnetic field"]
16070 pub zmag: f32,
16071 #[doc = "Absolute pressure"]
16072 pub abs_pressure: f32,
16073 #[doc = "Differential pressure"]
16074 pub diff_pressure: f32,
16075 #[doc = "Altitude calculated from pressure"]
16076 pub pressure_alt: f32,
16077 #[doc = "Temperature"]
16078 pub temperature: f32,
16079 #[doc = "Bitmap for fields that have updated since last message"]
16080 pub fields_updated: HighresImuUpdatedFlags,
16081 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
16082 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16083 pub id: u8,
16084}
16085impl HIGHRES_IMU_DATA {
16086 pub const ENCODED_LEN: usize = 63usize;
16087 pub const DEFAULT: Self = Self {
16088 time_usec: 0_u64,
16089 xacc: 0.0_f32,
16090 yacc: 0.0_f32,
16091 zacc: 0.0_f32,
16092 xgyro: 0.0_f32,
16093 ygyro: 0.0_f32,
16094 zgyro: 0.0_f32,
16095 xmag: 0.0_f32,
16096 ymag: 0.0_f32,
16097 zmag: 0.0_f32,
16098 abs_pressure: 0.0_f32,
16099 diff_pressure: 0.0_f32,
16100 pressure_alt: 0.0_f32,
16101 temperature: 0.0_f32,
16102 fields_updated: HighresImuUpdatedFlags::DEFAULT,
16103 id: 0_u8,
16104 };
16105 #[cfg(feature = "arbitrary")]
16106 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16107 use arbitrary::{Arbitrary, Unstructured};
16108 let mut buf = [0u8; 1024];
16109 rng.fill_bytes(&mut buf);
16110 let mut unstructured = Unstructured::new(&buf);
16111 Self::arbitrary(&mut unstructured).unwrap_or_default()
16112 }
16113}
16114impl Default for HIGHRES_IMU_DATA {
16115 fn default() -> Self {
16116 Self::DEFAULT.clone()
16117 }
16118}
16119impl MessageData for HIGHRES_IMU_DATA {
16120 type Message = MavMessage;
16121 const ID: u32 = 105u32;
16122 const NAME: &'static str = "HIGHRES_IMU";
16123 const EXTRA_CRC: u8 = 93u8;
16124 const ENCODED_LEN: usize = 63usize;
16125 fn deser(
16126 _version: MavlinkVersion,
16127 __input: &[u8],
16128 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16129 let avail_len = __input.len();
16130 let mut payload_buf = [0; Self::ENCODED_LEN];
16131 let mut buf = if avail_len < Self::ENCODED_LEN {
16132 payload_buf[0..avail_len].copy_from_slice(__input);
16133 Bytes::new(&payload_buf)
16134 } else {
16135 Bytes::new(__input)
16136 };
16137 let mut __struct = Self::default();
16138 __struct.time_usec = buf.get_u64_le();
16139 __struct.xacc = buf.get_f32_le();
16140 __struct.yacc = buf.get_f32_le();
16141 __struct.zacc = buf.get_f32_le();
16142 __struct.xgyro = buf.get_f32_le();
16143 __struct.ygyro = buf.get_f32_le();
16144 __struct.zgyro = buf.get_f32_le();
16145 __struct.xmag = buf.get_f32_le();
16146 __struct.ymag = buf.get_f32_le();
16147 __struct.zmag = buf.get_f32_le();
16148 __struct.abs_pressure = buf.get_f32_le();
16149 __struct.diff_pressure = buf.get_f32_le();
16150 __struct.pressure_alt = buf.get_f32_le();
16151 __struct.temperature = buf.get_f32_le();
16152 let tmp = buf.get_u16_le();
16153 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
16154 tmp & HighresImuUpdatedFlags::all().bits(),
16155 )
16156 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16157 flag_type: "HighresImuUpdatedFlags",
16158 value: tmp as u32,
16159 })?;
16160 __struct.id = buf.get_u8();
16161 Ok(__struct)
16162 }
16163 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16164 let mut __tmp = BytesMut::new(bytes);
16165 #[allow(clippy::absurd_extreme_comparisons)]
16166 #[allow(unused_comparisons)]
16167 if __tmp.remaining() < Self::ENCODED_LEN {
16168 panic!(
16169 "buffer is too small (need {} bytes, but got {})",
16170 Self::ENCODED_LEN,
16171 __tmp.remaining(),
16172 )
16173 }
16174 __tmp.put_u64_le(self.time_usec);
16175 __tmp.put_f32_le(self.xacc);
16176 __tmp.put_f32_le(self.yacc);
16177 __tmp.put_f32_le(self.zacc);
16178 __tmp.put_f32_le(self.xgyro);
16179 __tmp.put_f32_le(self.ygyro);
16180 __tmp.put_f32_le(self.zgyro);
16181 __tmp.put_f32_le(self.xmag);
16182 __tmp.put_f32_le(self.ymag);
16183 __tmp.put_f32_le(self.zmag);
16184 __tmp.put_f32_le(self.abs_pressure);
16185 __tmp.put_f32_le(self.diff_pressure);
16186 __tmp.put_f32_le(self.pressure_alt);
16187 __tmp.put_f32_le(self.temperature);
16188 __tmp.put_u16_le(self.fields_updated.bits());
16189 if matches!(version, MavlinkVersion::V2) {
16190 __tmp.put_u8(self.id);
16191 let len = __tmp.len();
16192 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16193 } else {
16194 __tmp.len()
16195 }
16196 }
16197}
16198#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
16199#[doc = "Message appropriate for high latency connections like Iridium."]
16200#[doc = ""]
16201#[doc = "ID: 234"]
16202#[derive(Debug, Clone, PartialEq)]
16203#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16204#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16205#[cfg_attr(feature = "ts", derive(TS))]
16206#[cfg_attr(feature = "ts", ts(export))]
16207pub struct HIGH_LATENCY_DATA {
16208 #[doc = "A bitfield for use for autopilot-specific flags."]
16209 pub custom_mode: u32,
16210 #[doc = "Latitude"]
16211 pub latitude: i32,
16212 #[doc = "Longitude"]
16213 pub longitude: i32,
16214 #[doc = "roll"]
16215 pub roll: i16,
16216 #[doc = "pitch"]
16217 pub pitch: i16,
16218 #[doc = "heading"]
16219 pub heading: u16,
16220 #[doc = "heading setpoint"]
16221 pub heading_sp: i16,
16222 #[doc = "Altitude above mean sea level"]
16223 pub altitude_amsl: i16,
16224 #[doc = "Altitude setpoint relative to the home position"]
16225 pub altitude_sp: i16,
16226 #[doc = "distance to target"]
16227 pub wp_distance: u16,
16228 #[doc = "Bitmap of enabled system modes."]
16229 pub base_mode: MavModeFlag,
16230 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
16231 pub landed_state: MavLandedState,
16232 #[doc = "throttle (percentage)"]
16233 pub throttle: i8,
16234 #[doc = "airspeed"]
16235 pub airspeed: u8,
16236 #[doc = "airspeed setpoint"]
16237 pub airspeed_sp: u8,
16238 #[doc = "groundspeed"]
16239 pub groundspeed: u8,
16240 #[doc = "climb rate"]
16241 pub climb_rate: i8,
16242 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16243 pub gps_nsat: u8,
16244 #[doc = "GPS Fix type."]
16245 pub gps_fix_type: GpsFixType,
16246 #[doc = "Remaining battery (percentage)"]
16247 pub battery_remaining: u8,
16248 #[doc = "Autopilot temperature (degrees C)"]
16249 pub temperature: i8,
16250 #[doc = "Air temperature (degrees C) from airspeed sensor"]
16251 pub temperature_air: i8,
16252 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
16253 pub failsafe: u8,
16254 #[doc = "current waypoint number"]
16255 pub wp_num: u8,
16256}
16257impl HIGH_LATENCY_DATA {
16258 pub const ENCODED_LEN: usize = 40usize;
16259 pub const DEFAULT: Self = Self {
16260 custom_mode: 0_u32,
16261 latitude: 0_i32,
16262 longitude: 0_i32,
16263 roll: 0_i16,
16264 pitch: 0_i16,
16265 heading: 0_u16,
16266 heading_sp: 0_i16,
16267 altitude_amsl: 0_i16,
16268 altitude_sp: 0_i16,
16269 wp_distance: 0_u16,
16270 base_mode: MavModeFlag::DEFAULT,
16271 landed_state: MavLandedState::DEFAULT,
16272 throttle: 0_i8,
16273 airspeed: 0_u8,
16274 airspeed_sp: 0_u8,
16275 groundspeed: 0_u8,
16276 climb_rate: 0_i8,
16277 gps_nsat: 0_u8,
16278 gps_fix_type: GpsFixType::DEFAULT,
16279 battery_remaining: 0_u8,
16280 temperature: 0_i8,
16281 temperature_air: 0_i8,
16282 failsafe: 0_u8,
16283 wp_num: 0_u8,
16284 };
16285 #[cfg(feature = "arbitrary")]
16286 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16287 use arbitrary::{Arbitrary, Unstructured};
16288 let mut buf = [0u8; 1024];
16289 rng.fill_bytes(&mut buf);
16290 let mut unstructured = Unstructured::new(&buf);
16291 Self::arbitrary(&mut unstructured).unwrap_or_default()
16292 }
16293}
16294impl Default for HIGH_LATENCY_DATA {
16295 fn default() -> Self {
16296 Self::DEFAULT.clone()
16297 }
16298}
16299impl MessageData for HIGH_LATENCY_DATA {
16300 type Message = MavMessage;
16301 const ID: u32 = 234u32;
16302 const NAME: &'static str = "HIGH_LATENCY";
16303 const EXTRA_CRC: u8 = 150u8;
16304 const ENCODED_LEN: usize = 40usize;
16305 fn deser(
16306 _version: MavlinkVersion,
16307 __input: &[u8],
16308 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16309 let avail_len = __input.len();
16310 let mut payload_buf = [0; Self::ENCODED_LEN];
16311 let mut buf = if avail_len < Self::ENCODED_LEN {
16312 payload_buf[0..avail_len].copy_from_slice(__input);
16313 Bytes::new(&payload_buf)
16314 } else {
16315 Bytes::new(__input)
16316 };
16317 let mut __struct = Self::default();
16318 __struct.custom_mode = buf.get_u32_le();
16319 __struct.latitude = buf.get_i32_le();
16320 __struct.longitude = buf.get_i32_le();
16321 __struct.roll = buf.get_i16_le();
16322 __struct.pitch = buf.get_i16_le();
16323 __struct.heading = buf.get_u16_le();
16324 __struct.heading_sp = buf.get_i16_le();
16325 __struct.altitude_amsl = buf.get_i16_le();
16326 __struct.altitude_sp = buf.get_i16_le();
16327 __struct.wp_distance = buf.get_u16_le();
16328 let tmp = buf.get_u8();
16329 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
16330 ::mavlink_core::error::ParserError::InvalidFlag {
16331 flag_type: "MavModeFlag",
16332 value: tmp as u32,
16333 },
16334 )?;
16335 let tmp = buf.get_u8();
16336 __struct.landed_state =
16337 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16338 enum_type: "MavLandedState",
16339 value: tmp as u32,
16340 })?;
16341 __struct.throttle = buf.get_i8();
16342 __struct.airspeed = buf.get_u8();
16343 __struct.airspeed_sp = buf.get_u8();
16344 __struct.groundspeed = buf.get_u8();
16345 __struct.climb_rate = buf.get_i8();
16346 __struct.gps_nsat = buf.get_u8();
16347 let tmp = buf.get_u8();
16348 __struct.gps_fix_type =
16349 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16350 enum_type: "GpsFixType",
16351 value: tmp as u32,
16352 })?;
16353 __struct.battery_remaining = buf.get_u8();
16354 __struct.temperature = buf.get_i8();
16355 __struct.temperature_air = buf.get_i8();
16356 __struct.failsafe = buf.get_u8();
16357 __struct.wp_num = buf.get_u8();
16358 Ok(__struct)
16359 }
16360 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16361 let mut __tmp = BytesMut::new(bytes);
16362 #[allow(clippy::absurd_extreme_comparisons)]
16363 #[allow(unused_comparisons)]
16364 if __tmp.remaining() < Self::ENCODED_LEN {
16365 panic!(
16366 "buffer is too small (need {} bytes, but got {})",
16367 Self::ENCODED_LEN,
16368 __tmp.remaining(),
16369 )
16370 }
16371 __tmp.put_u32_le(self.custom_mode);
16372 __tmp.put_i32_le(self.latitude);
16373 __tmp.put_i32_le(self.longitude);
16374 __tmp.put_i16_le(self.roll);
16375 __tmp.put_i16_le(self.pitch);
16376 __tmp.put_u16_le(self.heading);
16377 __tmp.put_i16_le(self.heading_sp);
16378 __tmp.put_i16_le(self.altitude_amsl);
16379 __tmp.put_i16_le(self.altitude_sp);
16380 __tmp.put_u16_le(self.wp_distance);
16381 __tmp.put_u8(self.base_mode.bits());
16382 __tmp.put_u8(self.landed_state as u8);
16383 __tmp.put_i8(self.throttle);
16384 __tmp.put_u8(self.airspeed);
16385 __tmp.put_u8(self.airspeed_sp);
16386 __tmp.put_u8(self.groundspeed);
16387 __tmp.put_i8(self.climb_rate);
16388 __tmp.put_u8(self.gps_nsat);
16389 __tmp.put_u8(self.gps_fix_type as u8);
16390 __tmp.put_u8(self.battery_remaining);
16391 __tmp.put_i8(self.temperature);
16392 __tmp.put_i8(self.temperature_air);
16393 __tmp.put_u8(self.failsafe);
16394 __tmp.put_u8(self.wp_num);
16395 if matches!(version, MavlinkVersion::V2) {
16396 let len = __tmp.len();
16397 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16398 } else {
16399 __tmp.len()
16400 }
16401 }
16402}
16403#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
16404#[doc = ""]
16405#[doc = "ID: 235"]
16406#[derive(Debug, Clone, PartialEq)]
16407#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16408#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16409#[cfg_attr(feature = "ts", derive(TS))]
16410#[cfg_attr(feature = "ts", ts(export))]
16411pub struct HIGH_LATENCY2_DATA {
16412 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
16413 pub timestamp: u32,
16414 #[doc = "Latitude"]
16415 pub latitude: i32,
16416 #[doc = "Longitude"]
16417 pub longitude: i32,
16418 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
16419 pub custom_mode: u16,
16420 #[doc = "Altitude above mean sea level"]
16421 pub altitude: i16,
16422 #[doc = "Altitude setpoint"]
16423 pub target_altitude: i16,
16424 #[doc = "Distance to target waypoint or position"]
16425 pub target_distance: u16,
16426 #[doc = "Current waypoint number"]
16427 pub wp_num: u16,
16428 #[doc = "Bitmap of failure flags."]
16429 pub failure_flags: HlFailureFlag,
16430 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
16431 pub mavtype: MavType,
16432 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
16433 pub autopilot: MavAutopilot,
16434 #[doc = "Heading"]
16435 pub heading: u8,
16436 #[doc = "Heading setpoint"]
16437 pub target_heading: u8,
16438 #[doc = "Throttle"]
16439 pub throttle: u8,
16440 #[doc = "Airspeed"]
16441 pub airspeed: u8,
16442 #[doc = "Airspeed setpoint"]
16443 pub airspeed_sp: u8,
16444 #[doc = "Groundspeed"]
16445 pub groundspeed: u8,
16446 #[doc = "Windspeed"]
16447 pub windspeed: u8,
16448 #[doc = "Wind heading"]
16449 pub wind_heading: u8,
16450 #[doc = "Maximum error horizontal position since last message"]
16451 pub eph: u8,
16452 #[doc = "Maximum error vertical position since last message"]
16453 pub epv: u8,
16454 #[doc = "Air temperature"]
16455 pub temperature_air: i8,
16456 #[doc = "Maximum climb rate magnitude since last message"]
16457 pub climb_rate: i8,
16458 #[doc = "Battery level (-1 if field not provided)."]
16459 pub battery: i8,
16460 #[doc = "Field for custom payload."]
16461 pub custom0: i8,
16462 #[doc = "Field for custom payload."]
16463 pub custom1: i8,
16464 #[doc = "Field for custom payload."]
16465 pub custom2: i8,
16466}
16467impl HIGH_LATENCY2_DATA {
16468 pub const ENCODED_LEN: usize = 42usize;
16469 pub const DEFAULT: Self = Self {
16470 timestamp: 0_u32,
16471 latitude: 0_i32,
16472 longitude: 0_i32,
16473 custom_mode: 0_u16,
16474 altitude: 0_i16,
16475 target_altitude: 0_i16,
16476 target_distance: 0_u16,
16477 wp_num: 0_u16,
16478 failure_flags: HlFailureFlag::DEFAULT,
16479 mavtype: MavType::DEFAULT,
16480 autopilot: MavAutopilot::DEFAULT,
16481 heading: 0_u8,
16482 target_heading: 0_u8,
16483 throttle: 0_u8,
16484 airspeed: 0_u8,
16485 airspeed_sp: 0_u8,
16486 groundspeed: 0_u8,
16487 windspeed: 0_u8,
16488 wind_heading: 0_u8,
16489 eph: 0_u8,
16490 epv: 0_u8,
16491 temperature_air: 0_i8,
16492 climb_rate: 0_i8,
16493 battery: 0_i8,
16494 custom0: 0_i8,
16495 custom1: 0_i8,
16496 custom2: 0_i8,
16497 };
16498 #[cfg(feature = "arbitrary")]
16499 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16500 use arbitrary::{Arbitrary, Unstructured};
16501 let mut buf = [0u8; 1024];
16502 rng.fill_bytes(&mut buf);
16503 let mut unstructured = Unstructured::new(&buf);
16504 Self::arbitrary(&mut unstructured).unwrap_or_default()
16505 }
16506}
16507impl Default for HIGH_LATENCY2_DATA {
16508 fn default() -> Self {
16509 Self::DEFAULT.clone()
16510 }
16511}
16512impl MessageData for HIGH_LATENCY2_DATA {
16513 type Message = MavMessage;
16514 const ID: u32 = 235u32;
16515 const NAME: &'static str = "HIGH_LATENCY2";
16516 const EXTRA_CRC: u8 = 179u8;
16517 const ENCODED_LEN: usize = 42usize;
16518 fn deser(
16519 _version: MavlinkVersion,
16520 __input: &[u8],
16521 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16522 let avail_len = __input.len();
16523 let mut payload_buf = [0; Self::ENCODED_LEN];
16524 let mut buf = if avail_len < Self::ENCODED_LEN {
16525 payload_buf[0..avail_len].copy_from_slice(__input);
16526 Bytes::new(&payload_buf)
16527 } else {
16528 Bytes::new(__input)
16529 };
16530 let mut __struct = Self::default();
16531 __struct.timestamp = buf.get_u32_le();
16532 __struct.latitude = buf.get_i32_le();
16533 __struct.longitude = buf.get_i32_le();
16534 __struct.custom_mode = buf.get_u16_le();
16535 __struct.altitude = buf.get_i16_le();
16536 __struct.target_altitude = buf.get_i16_le();
16537 __struct.target_distance = buf.get_u16_le();
16538 __struct.wp_num = buf.get_u16_le();
16539 let tmp = buf.get_u16_le();
16540 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
16541 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16542 flag_type: "HlFailureFlag",
16543 value: tmp as u32,
16544 })?;
16545 let tmp = buf.get_u8();
16546 __struct.mavtype =
16547 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16548 enum_type: "MavType",
16549 value: tmp as u32,
16550 })?;
16551 let tmp = buf.get_u8();
16552 __struct.autopilot =
16553 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16554 enum_type: "MavAutopilot",
16555 value: tmp as u32,
16556 })?;
16557 __struct.heading = buf.get_u8();
16558 __struct.target_heading = buf.get_u8();
16559 __struct.throttle = buf.get_u8();
16560 __struct.airspeed = buf.get_u8();
16561 __struct.airspeed_sp = buf.get_u8();
16562 __struct.groundspeed = buf.get_u8();
16563 __struct.windspeed = buf.get_u8();
16564 __struct.wind_heading = buf.get_u8();
16565 __struct.eph = buf.get_u8();
16566 __struct.epv = buf.get_u8();
16567 __struct.temperature_air = buf.get_i8();
16568 __struct.climb_rate = buf.get_i8();
16569 __struct.battery = buf.get_i8();
16570 __struct.custom0 = buf.get_i8();
16571 __struct.custom1 = buf.get_i8();
16572 __struct.custom2 = buf.get_i8();
16573 Ok(__struct)
16574 }
16575 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16576 let mut __tmp = BytesMut::new(bytes);
16577 #[allow(clippy::absurd_extreme_comparisons)]
16578 #[allow(unused_comparisons)]
16579 if __tmp.remaining() < Self::ENCODED_LEN {
16580 panic!(
16581 "buffer is too small (need {} bytes, but got {})",
16582 Self::ENCODED_LEN,
16583 __tmp.remaining(),
16584 )
16585 }
16586 __tmp.put_u32_le(self.timestamp);
16587 __tmp.put_i32_le(self.latitude);
16588 __tmp.put_i32_le(self.longitude);
16589 __tmp.put_u16_le(self.custom_mode);
16590 __tmp.put_i16_le(self.altitude);
16591 __tmp.put_i16_le(self.target_altitude);
16592 __tmp.put_u16_le(self.target_distance);
16593 __tmp.put_u16_le(self.wp_num);
16594 __tmp.put_u16_le(self.failure_flags.bits());
16595 __tmp.put_u8(self.mavtype as u8);
16596 __tmp.put_u8(self.autopilot as u8);
16597 __tmp.put_u8(self.heading);
16598 __tmp.put_u8(self.target_heading);
16599 __tmp.put_u8(self.throttle);
16600 __tmp.put_u8(self.airspeed);
16601 __tmp.put_u8(self.airspeed_sp);
16602 __tmp.put_u8(self.groundspeed);
16603 __tmp.put_u8(self.windspeed);
16604 __tmp.put_u8(self.wind_heading);
16605 __tmp.put_u8(self.eph);
16606 __tmp.put_u8(self.epv);
16607 __tmp.put_i8(self.temperature_air);
16608 __tmp.put_i8(self.climb_rate);
16609 __tmp.put_i8(self.battery);
16610 __tmp.put_i8(self.custom0);
16611 __tmp.put_i8(self.custom1);
16612 __tmp.put_i8(self.custom2);
16613 if matches!(version, MavlinkVersion::V2) {
16614 let len = __tmp.len();
16615 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16616 } else {
16617 __tmp.len()
16618 }
16619 }
16620}
16621#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
16622#[doc = ""]
16623#[doc = "ID: 93"]
16624#[derive(Debug, Clone, PartialEq)]
16625#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16626#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16627#[cfg_attr(feature = "ts", derive(TS))]
16628#[cfg_attr(feature = "ts", ts(export))]
16629pub struct HIL_ACTUATOR_CONTROLS_DATA {
16630 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16631 pub time_usec: u64,
16632 #[doc = "Flags bitmask."]
16633 pub flags: HilActuatorControlsFlags,
16634 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
16635 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16636 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16637 pub controls: [f32; 16],
16638 #[doc = "System mode. Includes arming state."]
16639 pub mode: MavModeFlag,
16640}
16641impl HIL_ACTUATOR_CONTROLS_DATA {
16642 pub const ENCODED_LEN: usize = 81usize;
16643 pub const DEFAULT: Self = Self {
16644 time_usec: 0_u64,
16645 flags: HilActuatorControlsFlags::DEFAULT,
16646 controls: [0.0_f32; 16usize],
16647 mode: MavModeFlag::DEFAULT,
16648 };
16649 #[cfg(feature = "arbitrary")]
16650 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16651 use arbitrary::{Arbitrary, Unstructured};
16652 let mut buf = [0u8; 1024];
16653 rng.fill_bytes(&mut buf);
16654 let mut unstructured = Unstructured::new(&buf);
16655 Self::arbitrary(&mut unstructured).unwrap_or_default()
16656 }
16657}
16658impl Default for HIL_ACTUATOR_CONTROLS_DATA {
16659 fn default() -> Self {
16660 Self::DEFAULT.clone()
16661 }
16662}
16663impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
16664 type Message = MavMessage;
16665 const ID: u32 = 93u32;
16666 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
16667 const EXTRA_CRC: u8 = 47u8;
16668 const ENCODED_LEN: usize = 81usize;
16669 fn deser(
16670 _version: MavlinkVersion,
16671 __input: &[u8],
16672 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16673 let avail_len = __input.len();
16674 let mut payload_buf = [0; Self::ENCODED_LEN];
16675 let mut buf = if avail_len < Self::ENCODED_LEN {
16676 payload_buf[0..avail_len].copy_from_slice(__input);
16677 Bytes::new(&payload_buf)
16678 } else {
16679 Bytes::new(__input)
16680 };
16681 let mut __struct = Self::default();
16682 __struct.time_usec = buf.get_u64_le();
16683 let tmp = buf.get_u64_le();
16684 __struct.flags =
16685 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
16686 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16687 flag_type: "HilActuatorControlsFlags",
16688 value: tmp as u32,
16689 })?;
16690 for v in &mut __struct.controls {
16691 let val = buf.get_f32_le();
16692 *v = val;
16693 }
16694 let tmp = buf.get_u8();
16695 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
16696 ::mavlink_core::error::ParserError::InvalidFlag {
16697 flag_type: "MavModeFlag",
16698 value: tmp as u32,
16699 },
16700 )?;
16701 Ok(__struct)
16702 }
16703 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16704 let mut __tmp = BytesMut::new(bytes);
16705 #[allow(clippy::absurd_extreme_comparisons)]
16706 #[allow(unused_comparisons)]
16707 if __tmp.remaining() < Self::ENCODED_LEN {
16708 panic!(
16709 "buffer is too small (need {} bytes, but got {})",
16710 Self::ENCODED_LEN,
16711 __tmp.remaining(),
16712 )
16713 }
16714 __tmp.put_u64_le(self.time_usec);
16715 __tmp.put_u64_le(self.flags.bits());
16716 for val in &self.controls {
16717 __tmp.put_f32_le(*val);
16718 }
16719 __tmp.put_u8(self.mode.bits());
16720 if matches!(version, MavlinkVersion::V2) {
16721 let len = __tmp.len();
16722 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16723 } else {
16724 __tmp.len()
16725 }
16726 }
16727}
16728#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
16729#[doc = ""]
16730#[doc = "ID: 91"]
16731#[derive(Debug, Clone, PartialEq)]
16732#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16733#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16734#[cfg_attr(feature = "ts", derive(TS))]
16735#[cfg_attr(feature = "ts", ts(export))]
16736pub struct HIL_CONTROLS_DATA {
16737 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16738 pub time_usec: u64,
16739 #[doc = "Control output -1 .. 1"]
16740 pub roll_ailerons: f32,
16741 #[doc = "Control output -1 .. 1"]
16742 pub pitch_elevator: f32,
16743 #[doc = "Control output -1 .. 1"]
16744 pub yaw_rudder: f32,
16745 #[doc = "Throttle 0 .. 1"]
16746 pub throttle: f32,
16747 #[doc = "Aux 1, -1 .. 1"]
16748 pub aux1: f32,
16749 #[doc = "Aux 2, -1 .. 1"]
16750 pub aux2: f32,
16751 #[doc = "Aux 3, -1 .. 1"]
16752 pub aux3: f32,
16753 #[doc = "Aux 4, -1 .. 1"]
16754 pub aux4: f32,
16755 #[doc = "System mode."]
16756 pub mode: MavMode,
16757 #[doc = "Navigation mode (MAV_NAV_MODE)"]
16758 pub nav_mode: u8,
16759}
16760impl HIL_CONTROLS_DATA {
16761 pub const ENCODED_LEN: usize = 42usize;
16762 pub const DEFAULT: Self = Self {
16763 time_usec: 0_u64,
16764 roll_ailerons: 0.0_f32,
16765 pitch_elevator: 0.0_f32,
16766 yaw_rudder: 0.0_f32,
16767 throttle: 0.0_f32,
16768 aux1: 0.0_f32,
16769 aux2: 0.0_f32,
16770 aux3: 0.0_f32,
16771 aux4: 0.0_f32,
16772 mode: MavMode::DEFAULT,
16773 nav_mode: 0_u8,
16774 };
16775 #[cfg(feature = "arbitrary")]
16776 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16777 use arbitrary::{Arbitrary, Unstructured};
16778 let mut buf = [0u8; 1024];
16779 rng.fill_bytes(&mut buf);
16780 let mut unstructured = Unstructured::new(&buf);
16781 Self::arbitrary(&mut unstructured).unwrap_or_default()
16782 }
16783}
16784impl Default for HIL_CONTROLS_DATA {
16785 fn default() -> Self {
16786 Self::DEFAULT.clone()
16787 }
16788}
16789impl MessageData for HIL_CONTROLS_DATA {
16790 type Message = MavMessage;
16791 const ID: u32 = 91u32;
16792 const NAME: &'static str = "HIL_CONTROLS";
16793 const EXTRA_CRC: u8 = 63u8;
16794 const ENCODED_LEN: usize = 42usize;
16795 fn deser(
16796 _version: MavlinkVersion,
16797 __input: &[u8],
16798 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16799 let avail_len = __input.len();
16800 let mut payload_buf = [0; Self::ENCODED_LEN];
16801 let mut buf = if avail_len < Self::ENCODED_LEN {
16802 payload_buf[0..avail_len].copy_from_slice(__input);
16803 Bytes::new(&payload_buf)
16804 } else {
16805 Bytes::new(__input)
16806 };
16807 let mut __struct = Self::default();
16808 __struct.time_usec = buf.get_u64_le();
16809 __struct.roll_ailerons = buf.get_f32_le();
16810 __struct.pitch_elevator = buf.get_f32_le();
16811 __struct.yaw_rudder = buf.get_f32_le();
16812 __struct.throttle = buf.get_f32_le();
16813 __struct.aux1 = buf.get_f32_le();
16814 __struct.aux2 = buf.get_f32_le();
16815 __struct.aux3 = buf.get_f32_le();
16816 __struct.aux4 = buf.get_f32_le();
16817 let tmp = buf.get_u8();
16818 __struct.mode =
16819 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16820 enum_type: "MavMode",
16821 value: tmp as u32,
16822 })?;
16823 __struct.nav_mode = buf.get_u8();
16824 Ok(__struct)
16825 }
16826 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16827 let mut __tmp = BytesMut::new(bytes);
16828 #[allow(clippy::absurd_extreme_comparisons)]
16829 #[allow(unused_comparisons)]
16830 if __tmp.remaining() < Self::ENCODED_LEN {
16831 panic!(
16832 "buffer is too small (need {} bytes, but got {})",
16833 Self::ENCODED_LEN,
16834 __tmp.remaining(),
16835 )
16836 }
16837 __tmp.put_u64_le(self.time_usec);
16838 __tmp.put_f32_le(self.roll_ailerons);
16839 __tmp.put_f32_le(self.pitch_elevator);
16840 __tmp.put_f32_le(self.yaw_rudder);
16841 __tmp.put_f32_le(self.throttle);
16842 __tmp.put_f32_le(self.aux1);
16843 __tmp.put_f32_le(self.aux2);
16844 __tmp.put_f32_le(self.aux3);
16845 __tmp.put_f32_le(self.aux4);
16846 __tmp.put_u8(self.mode as u8);
16847 __tmp.put_u8(self.nav_mode);
16848 if matches!(version, MavlinkVersion::V2) {
16849 let len = __tmp.len();
16850 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16851 } else {
16852 __tmp.len()
16853 }
16854 }
16855}
16856#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
16857#[doc = ""]
16858#[doc = "ID: 113"]
16859#[derive(Debug, Clone, PartialEq)]
16860#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16861#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16862#[cfg_attr(feature = "ts", derive(TS))]
16863#[cfg_attr(feature = "ts", ts(export))]
16864pub struct HIL_GPS_DATA {
16865 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16866 pub time_usec: u64,
16867 #[doc = "Latitude (WGS84)"]
16868 pub lat: i32,
16869 #[doc = "Longitude (WGS84)"]
16870 pub lon: i32,
16871 #[doc = "Altitude (MSL). Positive for up."]
16872 pub alt: i32,
16873 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16874 pub eph: u16,
16875 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16876 pub epv: u16,
16877 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
16878 pub vel: u16,
16879 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
16880 pub vn: i16,
16881 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
16882 pub ve: i16,
16883 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
16884 pub vd: i16,
16885 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
16886 pub cog: u16,
16887 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
16888 pub fix_type: u8,
16889 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16890 pub satellites_visible: u8,
16891 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
16892 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16893 pub id: u8,
16894 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
16895 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16896 pub yaw: u16,
16897}
16898impl HIL_GPS_DATA {
16899 pub const ENCODED_LEN: usize = 39usize;
16900 pub const DEFAULT: Self = Self {
16901 time_usec: 0_u64,
16902 lat: 0_i32,
16903 lon: 0_i32,
16904 alt: 0_i32,
16905 eph: 0_u16,
16906 epv: 0_u16,
16907 vel: 0_u16,
16908 vn: 0_i16,
16909 ve: 0_i16,
16910 vd: 0_i16,
16911 cog: 0_u16,
16912 fix_type: 0_u8,
16913 satellites_visible: 0_u8,
16914 id: 0_u8,
16915 yaw: 0_u16,
16916 };
16917 #[cfg(feature = "arbitrary")]
16918 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16919 use arbitrary::{Arbitrary, Unstructured};
16920 let mut buf = [0u8; 1024];
16921 rng.fill_bytes(&mut buf);
16922 let mut unstructured = Unstructured::new(&buf);
16923 Self::arbitrary(&mut unstructured).unwrap_or_default()
16924 }
16925}
16926impl Default for HIL_GPS_DATA {
16927 fn default() -> Self {
16928 Self::DEFAULT.clone()
16929 }
16930}
16931impl MessageData for HIL_GPS_DATA {
16932 type Message = MavMessage;
16933 const ID: u32 = 113u32;
16934 const NAME: &'static str = "HIL_GPS";
16935 const EXTRA_CRC: u8 = 124u8;
16936 const ENCODED_LEN: usize = 39usize;
16937 fn deser(
16938 _version: MavlinkVersion,
16939 __input: &[u8],
16940 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16941 let avail_len = __input.len();
16942 let mut payload_buf = [0; Self::ENCODED_LEN];
16943 let mut buf = if avail_len < Self::ENCODED_LEN {
16944 payload_buf[0..avail_len].copy_from_slice(__input);
16945 Bytes::new(&payload_buf)
16946 } else {
16947 Bytes::new(__input)
16948 };
16949 let mut __struct = Self::default();
16950 __struct.time_usec = buf.get_u64_le();
16951 __struct.lat = buf.get_i32_le();
16952 __struct.lon = buf.get_i32_le();
16953 __struct.alt = buf.get_i32_le();
16954 __struct.eph = buf.get_u16_le();
16955 __struct.epv = buf.get_u16_le();
16956 __struct.vel = buf.get_u16_le();
16957 __struct.vn = buf.get_i16_le();
16958 __struct.ve = buf.get_i16_le();
16959 __struct.vd = buf.get_i16_le();
16960 __struct.cog = buf.get_u16_le();
16961 __struct.fix_type = buf.get_u8();
16962 __struct.satellites_visible = buf.get_u8();
16963 __struct.id = buf.get_u8();
16964 __struct.yaw = buf.get_u16_le();
16965 Ok(__struct)
16966 }
16967 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16968 let mut __tmp = BytesMut::new(bytes);
16969 #[allow(clippy::absurd_extreme_comparisons)]
16970 #[allow(unused_comparisons)]
16971 if __tmp.remaining() < Self::ENCODED_LEN {
16972 panic!(
16973 "buffer is too small (need {} bytes, but got {})",
16974 Self::ENCODED_LEN,
16975 __tmp.remaining(),
16976 )
16977 }
16978 __tmp.put_u64_le(self.time_usec);
16979 __tmp.put_i32_le(self.lat);
16980 __tmp.put_i32_le(self.lon);
16981 __tmp.put_i32_le(self.alt);
16982 __tmp.put_u16_le(self.eph);
16983 __tmp.put_u16_le(self.epv);
16984 __tmp.put_u16_le(self.vel);
16985 __tmp.put_i16_le(self.vn);
16986 __tmp.put_i16_le(self.ve);
16987 __tmp.put_i16_le(self.vd);
16988 __tmp.put_u16_le(self.cog);
16989 __tmp.put_u8(self.fix_type);
16990 __tmp.put_u8(self.satellites_visible);
16991 if matches!(version, MavlinkVersion::V2) {
16992 __tmp.put_u8(self.id);
16993 __tmp.put_u16_le(self.yaw);
16994 let len = __tmp.len();
16995 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16996 } else {
16997 __tmp.len()
16998 }
16999 }
17000}
17001#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
17002#[doc = ""]
17003#[doc = "ID: 114"]
17004#[derive(Debug, Clone, PartialEq)]
17005#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17006#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17007#[cfg_attr(feature = "ts", derive(TS))]
17008#[cfg_attr(feature = "ts", ts(export))]
17009pub struct HIL_OPTICAL_FLOW_DATA {
17010 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17011 pub time_usec: u64,
17012 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
17013 pub integration_time_us: u32,
17014 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
17015 pub integrated_x: f32,
17016 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
17017 pub integrated_y: f32,
17018 #[doc = "RH rotation around X axis"]
17019 pub integrated_xgyro: f32,
17020 #[doc = "RH rotation around Y axis"]
17021 pub integrated_ygyro: f32,
17022 #[doc = "RH rotation around Z axis"]
17023 pub integrated_zgyro: f32,
17024 #[doc = "Time since the distance was sampled."]
17025 pub time_delta_distance_us: u32,
17026 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
17027 pub distance: f32,
17028 #[doc = "Temperature"]
17029 pub temperature: i16,
17030 #[doc = "Sensor ID"]
17031 pub sensor_id: u8,
17032 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
17033 pub quality: u8,
17034}
17035impl HIL_OPTICAL_FLOW_DATA {
17036 pub const ENCODED_LEN: usize = 44usize;
17037 pub const DEFAULT: Self = Self {
17038 time_usec: 0_u64,
17039 integration_time_us: 0_u32,
17040 integrated_x: 0.0_f32,
17041 integrated_y: 0.0_f32,
17042 integrated_xgyro: 0.0_f32,
17043 integrated_ygyro: 0.0_f32,
17044 integrated_zgyro: 0.0_f32,
17045 time_delta_distance_us: 0_u32,
17046 distance: 0.0_f32,
17047 temperature: 0_i16,
17048 sensor_id: 0_u8,
17049 quality: 0_u8,
17050 };
17051 #[cfg(feature = "arbitrary")]
17052 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17053 use arbitrary::{Arbitrary, Unstructured};
17054 let mut buf = [0u8; 1024];
17055 rng.fill_bytes(&mut buf);
17056 let mut unstructured = Unstructured::new(&buf);
17057 Self::arbitrary(&mut unstructured).unwrap_or_default()
17058 }
17059}
17060impl Default for HIL_OPTICAL_FLOW_DATA {
17061 fn default() -> Self {
17062 Self::DEFAULT.clone()
17063 }
17064}
17065impl MessageData for HIL_OPTICAL_FLOW_DATA {
17066 type Message = MavMessage;
17067 const ID: u32 = 114u32;
17068 const NAME: &'static str = "HIL_OPTICAL_FLOW";
17069 const EXTRA_CRC: u8 = 237u8;
17070 const ENCODED_LEN: usize = 44usize;
17071 fn deser(
17072 _version: MavlinkVersion,
17073 __input: &[u8],
17074 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17075 let avail_len = __input.len();
17076 let mut payload_buf = [0; Self::ENCODED_LEN];
17077 let mut buf = if avail_len < Self::ENCODED_LEN {
17078 payload_buf[0..avail_len].copy_from_slice(__input);
17079 Bytes::new(&payload_buf)
17080 } else {
17081 Bytes::new(__input)
17082 };
17083 let mut __struct = Self::default();
17084 __struct.time_usec = buf.get_u64_le();
17085 __struct.integration_time_us = buf.get_u32_le();
17086 __struct.integrated_x = buf.get_f32_le();
17087 __struct.integrated_y = buf.get_f32_le();
17088 __struct.integrated_xgyro = buf.get_f32_le();
17089 __struct.integrated_ygyro = buf.get_f32_le();
17090 __struct.integrated_zgyro = buf.get_f32_le();
17091 __struct.time_delta_distance_us = buf.get_u32_le();
17092 __struct.distance = buf.get_f32_le();
17093 __struct.temperature = buf.get_i16_le();
17094 __struct.sensor_id = buf.get_u8();
17095 __struct.quality = buf.get_u8();
17096 Ok(__struct)
17097 }
17098 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17099 let mut __tmp = BytesMut::new(bytes);
17100 #[allow(clippy::absurd_extreme_comparisons)]
17101 #[allow(unused_comparisons)]
17102 if __tmp.remaining() < Self::ENCODED_LEN {
17103 panic!(
17104 "buffer is too small (need {} bytes, but got {})",
17105 Self::ENCODED_LEN,
17106 __tmp.remaining(),
17107 )
17108 }
17109 __tmp.put_u64_le(self.time_usec);
17110 __tmp.put_u32_le(self.integration_time_us);
17111 __tmp.put_f32_le(self.integrated_x);
17112 __tmp.put_f32_le(self.integrated_y);
17113 __tmp.put_f32_le(self.integrated_xgyro);
17114 __tmp.put_f32_le(self.integrated_ygyro);
17115 __tmp.put_f32_le(self.integrated_zgyro);
17116 __tmp.put_u32_le(self.time_delta_distance_us);
17117 __tmp.put_f32_le(self.distance);
17118 __tmp.put_i16_le(self.temperature);
17119 __tmp.put_u8(self.sensor_id);
17120 __tmp.put_u8(self.quality);
17121 if matches!(version, MavlinkVersion::V2) {
17122 let len = __tmp.len();
17123 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17124 } else {
17125 __tmp.len()
17126 }
17127 }
17128}
17129#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
17130#[doc = ""]
17131#[doc = "ID: 92"]
17132#[derive(Debug, Clone, PartialEq)]
17133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17135#[cfg_attr(feature = "ts", derive(TS))]
17136#[cfg_attr(feature = "ts", ts(export))]
17137pub struct HIL_RC_INPUTS_RAW_DATA {
17138 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17139 pub time_usec: u64,
17140 #[doc = "RC channel 1 value"]
17141 pub chan1_raw: u16,
17142 #[doc = "RC channel 2 value"]
17143 pub chan2_raw: u16,
17144 #[doc = "RC channel 3 value"]
17145 pub chan3_raw: u16,
17146 #[doc = "RC channel 4 value"]
17147 pub chan4_raw: u16,
17148 #[doc = "RC channel 5 value"]
17149 pub chan5_raw: u16,
17150 #[doc = "RC channel 6 value"]
17151 pub chan6_raw: u16,
17152 #[doc = "RC channel 7 value"]
17153 pub chan7_raw: u16,
17154 #[doc = "RC channel 8 value"]
17155 pub chan8_raw: u16,
17156 #[doc = "RC channel 9 value"]
17157 pub chan9_raw: u16,
17158 #[doc = "RC channel 10 value"]
17159 pub chan10_raw: u16,
17160 #[doc = "RC channel 11 value"]
17161 pub chan11_raw: u16,
17162 #[doc = "RC channel 12 value"]
17163 pub chan12_raw: u16,
17164 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
17165 pub rssi: u8,
17166}
17167impl HIL_RC_INPUTS_RAW_DATA {
17168 pub const ENCODED_LEN: usize = 33usize;
17169 pub const DEFAULT: Self = Self {
17170 time_usec: 0_u64,
17171 chan1_raw: 0_u16,
17172 chan2_raw: 0_u16,
17173 chan3_raw: 0_u16,
17174 chan4_raw: 0_u16,
17175 chan5_raw: 0_u16,
17176 chan6_raw: 0_u16,
17177 chan7_raw: 0_u16,
17178 chan8_raw: 0_u16,
17179 chan9_raw: 0_u16,
17180 chan10_raw: 0_u16,
17181 chan11_raw: 0_u16,
17182 chan12_raw: 0_u16,
17183 rssi: 0_u8,
17184 };
17185 #[cfg(feature = "arbitrary")]
17186 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17187 use arbitrary::{Arbitrary, Unstructured};
17188 let mut buf = [0u8; 1024];
17189 rng.fill_bytes(&mut buf);
17190 let mut unstructured = Unstructured::new(&buf);
17191 Self::arbitrary(&mut unstructured).unwrap_or_default()
17192 }
17193}
17194impl Default for HIL_RC_INPUTS_RAW_DATA {
17195 fn default() -> Self {
17196 Self::DEFAULT.clone()
17197 }
17198}
17199impl MessageData for HIL_RC_INPUTS_RAW_DATA {
17200 type Message = MavMessage;
17201 const ID: u32 = 92u32;
17202 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
17203 const EXTRA_CRC: u8 = 54u8;
17204 const ENCODED_LEN: usize = 33usize;
17205 fn deser(
17206 _version: MavlinkVersion,
17207 __input: &[u8],
17208 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17209 let avail_len = __input.len();
17210 let mut payload_buf = [0; Self::ENCODED_LEN];
17211 let mut buf = if avail_len < Self::ENCODED_LEN {
17212 payload_buf[0..avail_len].copy_from_slice(__input);
17213 Bytes::new(&payload_buf)
17214 } else {
17215 Bytes::new(__input)
17216 };
17217 let mut __struct = Self::default();
17218 __struct.time_usec = buf.get_u64_le();
17219 __struct.chan1_raw = buf.get_u16_le();
17220 __struct.chan2_raw = buf.get_u16_le();
17221 __struct.chan3_raw = buf.get_u16_le();
17222 __struct.chan4_raw = buf.get_u16_le();
17223 __struct.chan5_raw = buf.get_u16_le();
17224 __struct.chan6_raw = buf.get_u16_le();
17225 __struct.chan7_raw = buf.get_u16_le();
17226 __struct.chan8_raw = buf.get_u16_le();
17227 __struct.chan9_raw = buf.get_u16_le();
17228 __struct.chan10_raw = buf.get_u16_le();
17229 __struct.chan11_raw = buf.get_u16_le();
17230 __struct.chan12_raw = buf.get_u16_le();
17231 __struct.rssi = buf.get_u8();
17232 Ok(__struct)
17233 }
17234 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17235 let mut __tmp = BytesMut::new(bytes);
17236 #[allow(clippy::absurd_extreme_comparisons)]
17237 #[allow(unused_comparisons)]
17238 if __tmp.remaining() < Self::ENCODED_LEN {
17239 panic!(
17240 "buffer is too small (need {} bytes, but got {})",
17241 Self::ENCODED_LEN,
17242 __tmp.remaining(),
17243 )
17244 }
17245 __tmp.put_u64_le(self.time_usec);
17246 __tmp.put_u16_le(self.chan1_raw);
17247 __tmp.put_u16_le(self.chan2_raw);
17248 __tmp.put_u16_le(self.chan3_raw);
17249 __tmp.put_u16_le(self.chan4_raw);
17250 __tmp.put_u16_le(self.chan5_raw);
17251 __tmp.put_u16_le(self.chan6_raw);
17252 __tmp.put_u16_le(self.chan7_raw);
17253 __tmp.put_u16_le(self.chan8_raw);
17254 __tmp.put_u16_le(self.chan9_raw);
17255 __tmp.put_u16_le(self.chan10_raw);
17256 __tmp.put_u16_le(self.chan11_raw);
17257 __tmp.put_u16_le(self.chan12_raw);
17258 __tmp.put_u8(self.rssi);
17259 if matches!(version, MavlinkVersion::V2) {
17260 let len = __tmp.len();
17261 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17262 } else {
17263 __tmp.len()
17264 }
17265 }
17266}
17267#[doc = "The IMU readings in SI units in NED body frame."]
17268#[doc = ""]
17269#[doc = "ID: 107"]
17270#[derive(Debug, Clone, PartialEq)]
17271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17273#[cfg_attr(feature = "ts", derive(TS))]
17274#[cfg_attr(feature = "ts", ts(export))]
17275pub struct HIL_SENSOR_DATA {
17276 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17277 pub time_usec: u64,
17278 #[doc = "X acceleration"]
17279 pub xacc: f32,
17280 #[doc = "Y acceleration"]
17281 pub yacc: f32,
17282 #[doc = "Z acceleration"]
17283 pub zacc: f32,
17284 #[doc = "Angular speed around X axis in body frame"]
17285 pub xgyro: f32,
17286 #[doc = "Angular speed around Y axis in body frame"]
17287 pub ygyro: f32,
17288 #[doc = "Angular speed around Z axis in body frame"]
17289 pub zgyro: f32,
17290 #[doc = "X Magnetic field"]
17291 pub xmag: f32,
17292 #[doc = "Y Magnetic field"]
17293 pub ymag: f32,
17294 #[doc = "Z Magnetic field"]
17295 pub zmag: f32,
17296 #[doc = "Absolute pressure"]
17297 pub abs_pressure: f32,
17298 #[doc = "Differential pressure (airspeed)"]
17299 pub diff_pressure: f32,
17300 #[doc = "Altitude calculated from pressure"]
17301 pub pressure_alt: f32,
17302 #[doc = "Temperature"]
17303 pub temperature: f32,
17304 #[doc = "Bitmap for fields that have updated since last message"]
17305 pub fields_updated: HilSensorUpdatedFlags,
17306 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
17307 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17308 pub id: u8,
17309}
17310impl HIL_SENSOR_DATA {
17311 pub const ENCODED_LEN: usize = 65usize;
17312 pub const DEFAULT: Self = Self {
17313 time_usec: 0_u64,
17314 xacc: 0.0_f32,
17315 yacc: 0.0_f32,
17316 zacc: 0.0_f32,
17317 xgyro: 0.0_f32,
17318 ygyro: 0.0_f32,
17319 zgyro: 0.0_f32,
17320 xmag: 0.0_f32,
17321 ymag: 0.0_f32,
17322 zmag: 0.0_f32,
17323 abs_pressure: 0.0_f32,
17324 diff_pressure: 0.0_f32,
17325 pressure_alt: 0.0_f32,
17326 temperature: 0.0_f32,
17327 fields_updated: HilSensorUpdatedFlags::DEFAULT,
17328 id: 0_u8,
17329 };
17330 #[cfg(feature = "arbitrary")]
17331 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17332 use arbitrary::{Arbitrary, Unstructured};
17333 let mut buf = [0u8; 1024];
17334 rng.fill_bytes(&mut buf);
17335 let mut unstructured = Unstructured::new(&buf);
17336 Self::arbitrary(&mut unstructured).unwrap_or_default()
17337 }
17338}
17339impl Default for HIL_SENSOR_DATA {
17340 fn default() -> Self {
17341 Self::DEFAULT.clone()
17342 }
17343}
17344impl MessageData for HIL_SENSOR_DATA {
17345 type Message = MavMessage;
17346 const ID: u32 = 107u32;
17347 const NAME: &'static str = "HIL_SENSOR";
17348 const EXTRA_CRC: u8 = 108u8;
17349 const ENCODED_LEN: usize = 65usize;
17350 fn deser(
17351 _version: MavlinkVersion,
17352 __input: &[u8],
17353 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17354 let avail_len = __input.len();
17355 let mut payload_buf = [0; Self::ENCODED_LEN];
17356 let mut buf = if avail_len < Self::ENCODED_LEN {
17357 payload_buf[0..avail_len].copy_from_slice(__input);
17358 Bytes::new(&payload_buf)
17359 } else {
17360 Bytes::new(__input)
17361 };
17362 let mut __struct = Self::default();
17363 __struct.time_usec = buf.get_u64_le();
17364 __struct.xacc = buf.get_f32_le();
17365 __struct.yacc = buf.get_f32_le();
17366 __struct.zacc = buf.get_f32_le();
17367 __struct.xgyro = buf.get_f32_le();
17368 __struct.ygyro = buf.get_f32_le();
17369 __struct.zgyro = buf.get_f32_le();
17370 __struct.xmag = buf.get_f32_le();
17371 __struct.ymag = buf.get_f32_le();
17372 __struct.zmag = buf.get_f32_le();
17373 __struct.abs_pressure = buf.get_f32_le();
17374 __struct.diff_pressure = buf.get_f32_le();
17375 __struct.pressure_alt = buf.get_f32_le();
17376 __struct.temperature = buf.get_f32_le();
17377 let tmp = buf.get_u32_le();
17378 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
17379 tmp & HilSensorUpdatedFlags::all().bits(),
17380 )
17381 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17382 flag_type: "HilSensorUpdatedFlags",
17383 value: tmp as u32,
17384 })?;
17385 __struct.id = buf.get_u8();
17386 Ok(__struct)
17387 }
17388 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17389 let mut __tmp = BytesMut::new(bytes);
17390 #[allow(clippy::absurd_extreme_comparisons)]
17391 #[allow(unused_comparisons)]
17392 if __tmp.remaining() < Self::ENCODED_LEN {
17393 panic!(
17394 "buffer is too small (need {} bytes, but got {})",
17395 Self::ENCODED_LEN,
17396 __tmp.remaining(),
17397 )
17398 }
17399 __tmp.put_u64_le(self.time_usec);
17400 __tmp.put_f32_le(self.xacc);
17401 __tmp.put_f32_le(self.yacc);
17402 __tmp.put_f32_le(self.zacc);
17403 __tmp.put_f32_le(self.xgyro);
17404 __tmp.put_f32_le(self.ygyro);
17405 __tmp.put_f32_le(self.zgyro);
17406 __tmp.put_f32_le(self.xmag);
17407 __tmp.put_f32_le(self.ymag);
17408 __tmp.put_f32_le(self.zmag);
17409 __tmp.put_f32_le(self.abs_pressure);
17410 __tmp.put_f32_le(self.diff_pressure);
17411 __tmp.put_f32_le(self.pressure_alt);
17412 __tmp.put_f32_le(self.temperature);
17413 __tmp.put_u32_le(self.fields_updated.bits());
17414 if matches!(version, MavlinkVersion::V2) {
17415 __tmp.put_u8(self.id);
17416 let len = __tmp.len();
17417 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17418 } else {
17419 __tmp.len()
17420 }
17421 }
17422}
17423#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
17424#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
17425#[doc = ""]
17426#[doc = "ID: 90"]
17427#[derive(Debug, Clone, PartialEq)]
17428#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17429#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17430#[cfg_attr(feature = "ts", derive(TS))]
17431#[cfg_attr(feature = "ts", ts(export))]
17432pub struct HIL_STATE_DATA {
17433 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17434 pub time_usec: u64,
17435 #[doc = "Roll angle"]
17436 pub roll: f32,
17437 #[doc = "Pitch angle"]
17438 pub pitch: f32,
17439 #[doc = "Yaw angle"]
17440 pub yaw: f32,
17441 #[doc = "Body frame roll / phi angular speed"]
17442 pub rollspeed: f32,
17443 #[doc = "Body frame pitch / theta angular speed"]
17444 pub pitchspeed: f32,
17445 #[doc = "Body frame yaw / psi angular speed"]
17446 pub yawspeed: f32,
17447 #[doc = "Latitude"]
17448 pub lat: i32,
17449 #[doc = "Longitude"]
17450 pub lon: i32,
17451 #[doc = "Altitude"]
17452 pub alt: i32,
17453 #[doc = "Ground X Speed (Latitude)"]
17454 pub vx: i16,
17455 #[doc = "Ground Y Speed (Longitude)"]
17456 pub vy: i16,
17457 #[doc = "Ground Z Speed (Altitude)"]
17458 pub vz: i16,
17459 #[doc = "X acceleration"]
17460 pub xacc: i16,
17461 #[doc = "Y acceleration"]
17462 pub yacc: i16,
17463 #[doc = "Z acceleration"]
17464 pub zacc: i16,
17465}
17466impl HIL_STATE_DATA {
17467 pub const ENCODED_LEN: usize = 56usize;
17468 pub const DEFAULT: Self = Self {
17469 time_usec: 0_u64,
17470 roll: 0.0_f32,
17471 pitch: 0.0_f32,
17472 yaw: 0.0_f32,
17473 rollspeed: 0.0_f32,
17474 pitchspeed: 0.0_f32,
17475 yawspeed: 0.0_f32,
17476 lat: 0_i32,
17477 lon: 0_i32,
17478 alt: 0_i32,
17479 vx: 0_i16,
17480 vy: 0_i16,
17481 vz: 0_i16,
17482 xacc: 0_i16,
17483 yacc: 0_i16,
17484 zacc: 0_i16,
17485 };
17486 #[cfg(feature = "arbitrary")]
17487 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17488 use arbitrary::{Arbitrary, Unstructured};
17489 let mut buf = [0u8; 1024];
17490 rng.fill_bytes(&mut buf);
17491 let mut unstructured = Unstructured::new(&buf);
17492 Self::arbitrary(&mut unstructured).unwrap_or_default()
17493 }
17494}
17495impl Default for HIL_STATE_DATA {
17496 fn default() -> Self {
17497 Self::DEFAULT.clone()
17498 }
17499}
17500impl MessageData for HIL_STATE_DATA {
17501 type Message = MavMessage;
17502 const ID: u32 = 90u32;
17503 const NAME: &'static str = "HIL_STATE";
17504 const EXTRA_CRC: u8 = 183u8;
17505 const ENCODED_LEN: usize = 56usize;
17506 fn deser(
17507 _version: MavlinkVersion,
17508 __input: &[u8],
17509 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17510 let avail_len = __input.len();
17511 let mut payload_buf = [0; Self::ENCODED_LEN];
17512 let mut buf = if avail_len < Self::ENCODED_LEN {
17513 payload_buf[0..avail_len].copy_from_slice(__input);
17514 Bytes::new(&payload_buf)
17515 } else {
17516 Bytes::new(__input)
17517 };
17518 let mut __struct = Self::default();
17519 __struct.time_usec = buf.get_u64_le();
17520 __struct.roll = buf.get_f32_le();
17521 __struct.pitch = buf.get_f32_le();
17522 __struct.yaw = buf.get_f32_le();
17523 __struct.rollspeed = buf.get_f32_le();
17524 __struct.pitchspeed = buf.get_f32_le();
17525 __struct.yawspeed = buf.get_f32_le();
17526 __struct.lat = buf.get_i32_le();
17527 __struct.lon = buf.get_i32_le();
17528 __struct.alt = buf.get_i32_le();
17529 __struct.vx = buf.get_i16_le();
17530 __struct.vy = buf.get_i16_le();
17531 __struct.vz = buf.get_i16_le();
17532 __struct.xacc = buf.get_i16_le();
17533 __struct.yacc = buf.get_i16_le();
17534 __struct.zacc = buf.get_i16_le();
17535 Ok(__struct)
17536 }
17537 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17538 let mut __tmp = BytesMut::new(bytes);
17539 #[allow(clippy::absurd_extreme_comparisons)]
17540 #[allow(unused_comparisons)]
17541 if __tmp.remaining() < Self::ENCODED_LEN {
17542 panic!(
17543 "buffer is too small (need {} bytes, but got {})",
17544 Self::ENCODED_LEN,
17545 __tmp.remaining(),
17546 )
17547 }
17548 __tmp.put_u64_le(self.time_usec);
17549 __tmp.put_f32_le(self.roll);
17550 __tmp.put_f32_le(self.pitch);
17551 __tmp.put_f32_le(self.yaw);
17552 __tmp.put_f32_le(self.rollspeed);
17553 __tmp.put_f32_le(self.pitchspeed);
17554 __tmp.put_f32_le(self.yawspeed);
17555 __tmp.put_i32_le(self.lat);
17556 __tmp.put_i32_le(self.lon);
17557 __tmp.put_i32_le(self.alt);
17558 __tmp.put_i16_le(self.vx);
17559 __tmp.put_i16_le(self.vy);
17560 __tmp.put_i16_le(self.vz);
17561 __tmp.put_i16_le(self.xacc);
17562 __tmp.put_i16_le(self.yacc);
17563 __tmp.put_i16_le(self.zacc);
17564 if matches!(version, MavlinkVersion::V2) {
17565 let len = __tmp.len();
17566 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17567 } else {
17568 __tmp.len()
17569 }
17570 }
17571}
17572#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
17573#[doc = ""]
17574#[doc = "ID: 115"]
17575#[derive(Debug, Clone, PartialEq)]
17576#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17577#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17578#[cfg_attr(feature = "ts", derive(TS))]
17579#[cfg_attr(feature = "ts", ts(export))]
17580pub struct HIL_STATE_QUATERNION_DATA {
17581 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17582 pub time_usec: u64,
17583 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
17584 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17585 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17586 pub attitude_quaternion: [f32; 4],
17587 #[doc = "Body frame roll / phi angular speed"]
17588 pub rollspeed: f32,
17589 #[doc = "Body frame pitch / theta angular speed"]
17590 pub pitchspeed: f32,
17591 #[doc = "Body frame yaw / psi angular speed"]
17592 pub yawspeed: f32,
17593 #[doc = "Latitude"]
17594 pub lat: i32,
17595 #[doc = "Longitude"]
17596 pub lon: i32,
17597 #[doc = "Altitude"]
17598 pub alt: i32,
17599 #[doc = "Ground X Speed (Latitude)"]
17600 pub vx: i16,
17601 #[doc = "Ground Y Speed (Longitude)"]
17602 pub vy: i16,
17603 #[doc = "Ground Z Speed (Altitude)"]
17604 pub vz: i16,
17605 #[doc = "Indicated airspeed"]
17606 pub ind_airspeed: u16,
17607 #[doc = "True airspeed"]
17608 pub true_airspeed: u16,
17609 #[doc = "X acceleration"]
17610 pub xacc: i16,
17611 #[doc = "Y acceleration"]
17612 pub yacc: i16,
17613 #[doc = "Z acceleration"]
17614 pub zacc: i16,
17615}
17616impl HIL_STATE_QUATERNION_DATA {
17617 pub const ENCODED_LEN: usize = 64usize;
17618 pub const DEFAULT: Self = Self {
17619 time_usec: 0_u64,
17620 attitude_quaternion: [0.0_f32; 4usize],
17621 rollspeed: 0.0_f32,
17622 pitchspeed: 0.0_f32,
17623 yawspeed: 0.0_f32,
17624 lat: 0_i32,
17625 lon: 0_i32,
17626 alt: 0_i32,
17627 vx: 0_i16,
17628 vy: 0_i16,
17629 vz: 0_i16,
17630 ind_airspeed: 0_u16,
17631 true_airspeed: 0_u16,
17632 xacc: 0_i16,
17633 yacc: 0_i16,
17634 zacc: 0_i16,
17635 };
17636 #[cfg(feature = "arbitrary")]
17637 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17638 use arbitrary::{Arbitrary, Unstructured};
17639 let mut buf = [0u8; 1024];
17640 rng.fill_bytes(&mut buf);
17641 let mut unstructured = Unstructured::new(&buf);
17642 Self::arbitrary(&mut unstructured).unwrap_or_default()
17643 }
17644}
17645impl Default for HIL_STATE_QUATERNION_DATA {
17646 fn default() -> Self {
17647 Self::DEFAULT.clone()
17648 }
17649}
17650impl MessageData for HIL_STATE_QUATERNION_DATA {
17651 type Message = MavMessage;
17652 const ID: u32 = 115u32;
17653 const NAME: &'static str = "HIL_STATE_QUATERNION";
17654 const EXTRA_CRC: u8 = 4u8;
17655 const ENCODED_LEN: usize = 64usize;
17656 fn deser(
17657 _version: MavlinkVersion,
17658 __input: &[u8],
17659 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17660 let avail_len = __input.len();
17661 let mut payload_buf = [0; Self::ENCODED_LEN];
17662 let mut buf = if avail_len < Self::ENCODED_LEN {
17663 payload_buf[0..avail_len].copy_from_slice(__input);
17664 Bytes::new(&payload_buf)
17665 } else {
17666 Bytes::new(__input)
17667 };
17668 let mut __struct = Self::default();
17669 __struct.time_usec = buf.get_u64_le();
17670 for v in &mut __struct.attitude_quaternion {
17671 let val = buf.get_f32_le();
17672 *v = val;
17673 }
17674 __struct.rollspeed = buf.get_f32_le();
17675 __struct.pitchspeed = buf.get_f32_le();
17676 __struct.yawspeed = buf.get_f32_le();
17677 __struct.lat = buf.get_i32_le();
17678 __struct.lon = buf.get_i32_le();
17679 __struct.alt = buf.get_i32_le();
17680 __struct.vx = buf.get_i16_le();
17681 __struct.vy = buf.get_i16_le();
17682 __struct.vz = buf.get_i16_le();
17683 __struct.ind_airspeed = buf.get_u16_le();
17684 __struct.true_airspeed = buf.get_u16_le();
17685 __struct.xacc = buf.get_i16_le();
17686 __struct.yacc = buf.get_i16_le();
17687 __struct.zacc = buf.get_i16_le();
17688 Ok(__struct)
17689 }
17690 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17691 let mut __tmp = BytesMut::new(bytes);
17692 #[allow(clippy::absurd_extreme_comparisons)]
17693 #[allow(unused_comparisons)]
17694 if __tmp.remaining() < Self::ENCODED_LEN {
17695 panic!(
17696 "buffer is too small (need {} bytes, but got {})",
17697 Self::ENCODED_LEN,
17698 __tmp.remaining(),
17699 )
17700 }
17701 __tmp.put_u64_le(self.time_usec);
17702 for val in &self.attitude_quaternion {
17703 __tmp.put_f32_le(*val);
17704 }
17705 __tmp.put_f32_le(self.rollspeed);
17706 __tmp.put_f32_le(self.pitchspeed);
17707 __tmp.put_f32_le(self.yawspeed);
17708 __tmp.put_i32_le(self.lat);
17709 __tmp.put_i32_le(self.lon);
17710 __tmp.put_i32_le(self.alt);
17711 __tmp.put_i16_le(self.vx);
17712 __tmp.put_i16_le(self.vy);
17713 __tmp.put_i16_le(self.vz);
17714 __tmp.put_u16_le(self.ind_airspeed);
17715 __tmp.put_u16_le(self.true_airspeed);
17716 __tmp.put_i16_le(self.xacc);
17717 __tmp.put_i16_le(self.yacc);
17718 __tmp.put_i16_le(self.zacc);
17719 if matches!(version, MavlinkVersion::V2) {
17720 let len = __tmp.len();
17721 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17722 } else {
17723 __tmp.len()
17724 }
17725 }
17726}
17727#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
17728#[doc = ""]
17729#[doc = "ID: 242"]
17730#[derive(Debug, Clone, PartialEq)]
17731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17733#[cfg_attr(feature = "ts", derive(TS))]
17734#[cfg_attr(feature = "ts", ts(export))]
17735pub struct HOME_POSITION_DATA {
17736 #[doc = "Latitude (WGS84)"]
17737 pub latitude: i32,
17738 #[doc = "Longitude (WGS84)"]
17739 pub longitude: i32,
17740 #[doc = "Altitude (MSL). Positive for up."]
17741 pub altitude: i32,
17742 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
17743 pub x: f32,
17744 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
17745 pub y: f32,
17746 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
17747 pub z: f32,
17748 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
17749 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17750 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17751 pub q: [f32; 4],
17752 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17753 pub approach_x: f32,
17754 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17755 pub approach_y: f32,
17756 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17757 pub approach_z: f32,
17758 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17759 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17760 pub time_usec: u64,
17761}
17762impl HOME_POSITION_DATA {
17763 pub const ENCODED_LEN: usize = 60usize;
17764 pub const DEFAULT: Self = Self {
17765 latitude: 0_i32,
17766 longitude: 0_i32,
17767 altitude: 0_i32,
17768 x: 0.0_f32,
17769 y: 0.0_f32,
17770 z: 0.0_f32,
17771 q: [0.0_f32; 4usize],
17772 approach_x: 0.0_f32,
17773 approach_y: 0.0_f32,
17774 approach_z: 0.0_f32,
17775 time_usec: 0_u64,
17776 };
17777 #[cfg(feature = "arbitrary")]
17778 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17779 use arbitrary::{Arbitrary, Unstructured};
17780 let mut buf = [0u8; 1024];
17781 rng.fill_bytes(&mut buf);
17782 let mut unstructured = Unstructured::new(&buf);
17783 Self::arbitrary(&mut unstructured).unwrap_or_default()
17784 }
17785}
17786impl Default for HOME_POSITION_DATA {
17787 fn default() -> Self {
17788 Self::DEFAULT.clone()
17789 }
17790}
17791impl MessageData for HOME_POSITION_DATA {
17792 type Message = MavMessage;
17793 const ID: u32 = 242u32;
17794 const NAME: &'static str = "HOME_POSITION";
17795 const EXTRA_CRC: u8 = 104u8;
17796 const ENCODED_LEN: usize = 60usize;
17797 fn deser(
17798 _version: MavlinkVersion,
17799 __input: &[u8],
17800 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17801 let avail_len = __input.len();
17802 let mut payload_buf = [0; Self::ENCODED_LEN];
17803 let mut buf = if avail_len < Self::ENCODED_LEN {
17804 payload_buf[0..avail_len].copy_from_slice(__input);
17805 Bytes::new(&payload_buf)
17806 } else {
17807 Bytes::new(__input)
17808 };
17809 let mut __struct = Self::default();
17810 __struct.latitude = buf.get_i32_le();
17811 __struct.longitude = buf.get_i32_le();
17812 __struct.altitude = buf.get_i32_le();
17813 __struct.x = buf.get_f32_le();
17814 __struct.y = buf.get_f32_le();
17815 __struct.z = buf.get_f32_le();
17816 for v in &mut __struct.q {
17817 let val = buf.get_f32_le();
17818 *v = val;
17819 }
17820 __struct.approach_x = buf.get_f32_le();
17821 __struct.approach_y = buf.get_f32_le();
17822 __struct.approach_z = buf.get_f32_le();
17823 __struct.time_usec = buf.get_u64_le();
17824 Ok(__struct)
17825 }
17826 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17827 let mut __tmp = BytesMut::new(bytes);
17828 #[allow(clippy::absurd_extreme_comparisons)]
17829 #[allow(unused_comparisons)]
17830 if __tmp.remaining() < Self::ENCODED_LEN {
17831 panic!(
17832 "buffer is too small (need {} bytes, but got {})",
17833 Self::ENCODED_LEN,
17834 __tmp.remaining(),
17835 )
17836 }
17837 __tmp.put_i32_le(self.latitude);
17838 __tmp.put_i32_le(self.longitude);
17839 __tmp.put_i32_le(self.altitude);
17840 __tmp.put_f32_le(self.x);
17841 __tmp.put_f32_le(self.y);
17842 __tmp.put_f32_le(self.z);
17843 for val in &self.q {
17844 __tmp.put_f32_le(*val);
17845 }
17846 __tmp.put_f32_le(self.approach_x);
17847 __tmp.put_f32_le(self.approach_y);
17848 __tmp.put_f32_le(self.approach_z);
17849 if matches!(version, MavlinkVersion::V2) {
17850 __tmp.put_u64_le(self.time_usec);
17851 let len = __tmp.len();
17852 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17853 } else {
17854 __tmp.len()
17855 }
17856 }
17857}
17858#[doc = "Temperature and humidity from hygrometer."]
17859#[doc = ""]
17860#[doc = "ID: 12920"]
17861#[derive(Debug, Clone, PartialEq)]
17862#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17863#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17864#[cfg_attr(feature = "ts", derive(TS))]
17865#[cfg_attr(feature = "ts", ts(export))]
17866pub struct HYGROMETER_SENSOR_DATA {
17867 #[doc = "Temperature"]
17868 pub temperature: i16,
17869 #[doc = "Humidity"]
17870 pub humidity: u16,
17871 #[doc = "Hygrometer ID"]
17872 pub id: u8,
17873}
17874impl HYGROMETER_SENSOR_DATA {
17875 pub const ENCODED_LEN: usize = 5usize;
17876 pub const DEFAULT: Self = Self {
17877 temperature: 0_i16,
17878 humidity: 0_u16,
17879 id: 0_u8,
17880 };
17881 #[cfg(feature = "arbitrary")]
17882 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17883 use arbitrary::{Arbitrary, Unstructured};
17884 let mut buf = [0u8; 1024];
17885 rng.fill_bytes(&mut buf);
17886 let mut unstructured = Unstructured::new(&buf);
17887 Self::arbitrary(&mut unstructured).unwrap_or_default()
17888 }
17889}
17890impl Default for HYGROMETER_SENSOR_DATA {
17891 fn default() -> Self {
17892 Self::DEFAULT.clone()
17893 }
17894}
17895impl MessageData for HYGROMETER_SENSOR_DATA {
17896 type Message = MavMessage;
17897 const ID: u32 = 12920u32;
17898 const NAME: &'static str = "HYGROMETER_SENSOR";
17899 const EXTRA_CRC: u8 = 20u8;
17900 const ENCODED_LEN: usize = 5usize;
17901 fn deser(
17902 _version: MavlinkVersion,
17903 __input: &[u8],
17904 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17905 let avail_len = __input.len();
17906 let mut payload_buf = [0; Self::ENCODED_LEN];
17907 let mut buf = if avail_len < Self::ENCODED_LEN {
17908 payload_buf[0..avail_len].copy_from_slice(__input);
17909 Bytes::new(&payload_buf)
17910 } else {
17911 Bytes::new(__input)
17912 };
17913 let mut __struct = Self::default();
17914 __struct.temperature = buf.get_i16_le();
17915 __struct.humidity = buf.get_u16_le();
17916 __struct.id = buf.get_u8();
17917 Ok(__struct)
17918 }
17919 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17920 let mut __tmp = BytesMut::new(bytes);
17921 #[allow(clippy::absurd_extreme_comparisons)]
17922 #[allow(unused_comparisons)]
17923 if __tmp.remaining() < Self::ENCODED_LEN {
17924 panic!(
17925 "buffer is too small (need {} bytes, but got {})",
17926 Self::ENCODED_LEN,
17927 __tmp.remaining(),
17928 )
17929 }
17930 __tmp.put_i16_le(self.temperature);
17931 __tmp.put_u16_le(self.humidity);
17932 __tmp.put_u8(self.id);
17933 if matches!(version, MavlinkVersion::V2) {
17934 let len = __tmp.len();
17935 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17936 } else {
17937 __tmp.len()
17938 }
17939 }
17940}
17941#[doc = "Illuminator status."]
17942#[doc = ""]
17943#[doc = "ID: 440"]
17944#[derive(Debug, Clone, PartialEq)]
17945#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17946#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17947#[cfg_attr(feature = "ts", derive(TS))]
17948#[cfg_attr(feature = "ts", ts(export))]
17949pub struct ILLUMINATOR_STATUS_DATA {
17950 #[doc = "Time since the start-up of the illuminator in ms"]
17951 pub uptime_ms: u32,
17952 #[doc = "Errors"]
17953 pub error_status: IlluminatorErrorFlags,
17954 #[doc = "Illuminator brightness"]
17955 pub brightness: f32,
17956 #[doc = "Illuminator strobing period in seconds"]
17957 pub strobe_period: f32,
17958 #[doc = "Illuminator strobing duty cycle"]
17959 pub strobe_duty_cycle: f32,
17960 #[doc = "Temperature in Celsius"]
17961 pub temp_c: f32,
17962 #[doc = "Minimum strobing period in seconds"]
17963 pub min_strobe_period: f32,
17964 #[doc = "Maximum strobing period in seconds"]
17965 pub max_strobe_period: f32,
17966 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
17967 pub enable: u8,
17968 #[doc = "Supported illuminator modes"]
17969 pub mode_bitmask: IlluminatorMode,
17970 #[doc = "Illuminator mode"]
17971 pub mode: IlluminatorMode,
17972}
17973impl ILLUMINATOR_STATUS_DATA {
17974 pub const ENCODED_LEN: usize = 35usize;
17975 pub const DEFAULT: Self = Self {
17976 uptime_ms: 0_u32,
17977 error_status: IlluminatorErrorFlags::DEFAULT,
17978 brightness: 0.0_f32,
17979 strobe_period: 0.0_f32,
17980 strobe_duty_cycle: 0.0_f32,
17981 temp_c: 0.0_f32,
17982 min_strobe_period: 0.0_f32,
17983 max_strobe_period: 0.0_f32,
17984 enable: 0_u8,
17985 mode_bitmask: IlluminatorMode::DEFAULT,
17986 mode: IlluminatorMode::DEFAULT,
17987 };
17988 #[cfg(feature = "arbitrary")]
17989 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17990 use arbitrary::{Arbitrary, Unstructured};
17991 let mut buf = [0u8; 1024];
17992 rng.fill_bytes(&mut buf);
17993 let mut unstructured = Unstructured::new(&buf);
17994 Self::arbitrary(&mut unstructured).unwrap_or_default()
17995 }
17996}
17997impl Default for ILLUMINATOR_STATUS_DATA {
17998 fn default() -> Self {
17999 Self::DEFAULT.clone()
18000 }
18001}
18002impl MessageData for ILLUMINATOR_STATUS_DATA {
18003 type Message = MavMessage;
18004 const ID: u32 = 440u32;
18005 const NAME: &'static str = "ILLUMINATOR_STATUS";
18006 const EXTRA_CRC: u8 = 66u8;
18007 const ENCODED_LEN: usize = 35usize;
18008 fn deser(
18009 _version: MavlinkVersion,
18010 __input: &[u8],
18011 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18012 let avail_len = __input.len();
18013 let mut payload_buf = [0; Self::ENCODED_LEN];
18014 let mut buf = if avail_len < Self::ENCODED_LEN {
18015 payload_buf[0..avail_len].copy_from_slice(__input);
18016 Bytes::new(&payload_buf)
18017 } else {
18018 Bytes::new(__input)
18019 };
18020 let mut __struct = Self::default();
18021 __struct.uptime_ms = buf.get_u32_le();
18022 let tmp = buf.get_u32_le();
18023 __struct.error_status = IlluminatorErrorFlags::from_bits(
18024 tmp & IlluminatorErrorFlags::all().bits(),
18025 )
18026 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
18027 flag_type: "IlluminatorErrorFlags",
18028 value: tmp as u32,
18029 })?;
18030 __struct.brightness = buf.get_f32_le();
18031 __struct.strobe_period = buf.get_f32_le();
18032 __struct.strobe_duty_cycle = buf.get_f32_le();
18033 __struct.temp_c = buf.get_f32_le();
18034 __struct.min_strobe_period = buf.get_f32_le();
18035 __struct.max_strobe_period = buf.get_f32_le();
18036 __struct.enable = buf.get_u8();
18037 let tmp = buf.get_u8();
18038 __struct.mode_bitmask =
18039 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18040 enum_type: "IlluminatorMode",
18041 value: tmp as u32,
18042 })?;
18043 let tmp = buf.get_u8();
18044 __struct.mode =
18045 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18046 enum_type: "IlluminatorMode",
18047 value: tmp as u32,
18048 })?;
18049 Ok(__struct)
18050 }
18051 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18052 let mut __tmp = BytesMut::new(bytes);
18053 #[allow(clippy::absurd_extreme_comparisons)]
18054 #[allow(unused_comparisons)]
18055 if __tmp.remaining() < Self::ENCODED_LEN {
18056 panic!(
18057 "buffer is too small (need {} bytes, but got {})",
18058 Self::ENCODED_LEN,
18059 __tmp.remaining(),
18060 )
18061 }
18062 __tmp.put_u32_le(self.uptime_ms);
18063 __tmp.put_u32_le(self.error_status.bits());
18064 __tmp.put_f32_le(self.brightness);
18065 __tmp.put_f32_le(self.strobe_period);
18066 __tmp.put_f32_le(self.strobe_duty_cycle);
18067 __tmp.put_f32_le(self.temp_c);
18068 __tmp.put_f32_le(self.min_strobe_period);
18069 __tmp.put_f32_le(self.max_strobe_period);
18070 __tmp.put_u8(self.enable);
18071 __tmp.put_u8(self.mode_bitmask as u8);
18072 __tmp.put_u8(self.mode as u8);
18073 if matches!(version, MavlinkVersion::V2) {
18074 let len = __tmp.len();
18075 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18076 } else {
18077 __tmp.len()
18078 }
18079 }
18080}
18081#[doc = "Status of the Iridium SBD link."]
18082#[doc = ""]
18083#[doc = "ID: 335"]
18084#[derive(Debug, Clone, PartialEq)]
18085#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18087#[cfg_attr(feature = "ts", derive(TS))]
18088#[cfg_attr(feature = "ts", ts(export))]
18089pub struct ISBD_LINK_STATUS_DATA {
18090 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18091 pub timestamp: u64,
18092 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18093 pub last_heartbeat: u64,
18094 #[doc = "Number of failed SBD sessions."]
18095 pub failed_sessions: u16,
18096 #[doc = "Number of successful SBD sessions."]
18097 pub successful_sessions: u16,
18098 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
18099 pub signal_quality: u8,
18100 #[doc = "1: Ring call pending, 0: No call pending."]
18101 pub ring_pending: u8,
18102 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
18103 pub tx_session_pending: u8,
18104 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
18105 pub rx_session_pending: u8,
18106}
18107impl ISBD_LINK_STATUS_DATA {
18108 pub const ENCODED_LEN: usize = 24usize;
18109 pub const DEFAULT: Self = Self {
18110 timestamp: 0_u64,
18111 last_heartbeat: 0_u64,
18112 failed_sessions: 0_u16,
18113 successful_sessions: 0_u16,
18114 signal_quality: 0_u8,
18115 ring_pending: 0_u8,
18116 tx_session_pending: 0_u8,
18117 rx_session_pending: 0_u8,
18118 };
18119 #[cfg(feature = "arbitrary")]
18120 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18121 use arbitrary::{Arbitrary, Unstructured};
18122 let mut buf = [0u8; 1024];
18123 rng.fill_bytes(&mut buf);
18124 let mut unstructured = Unstructured::new(&buf);
18125 Self::arbitrary(&mut unstructured).unwrap_or_default()
18126 }
18127}
18128impl Default for ISBD_LINK_STATUS_DATA {
18129 fn default() -> Self {
18130 Self::DEFAULT.clone()
18131 }
18132}
18133impl MessageData for ISBD_LINK_STATUS_DATA {
18134 type Message = MavMessage;
18135 const ID: u32 = 335u32;
18136 const NAME: &'static str = "ISBD_LINK_STATUS";
18137 const EXTRA_CRC: u8 = 225u8;
18138 const ENCODED_LEN: usize = 24usize;
18139 fn deser(
18140 _version: MavlinkVersion,
18141 __input: &[u8],
18142 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18143 let avail_len = __input.len();
18144 let mut payload_buf = [0; Self::ENCODED_LEN];
18145 let mut buf = if avail_len < Self::ENCODED_LEN {
18146 payload_buf[0..avail_len].copy_from_slice(__input);
18147 Bytes::new(&payload_buf)
18148 } else {
18149 Bytes::new(__input)
18150 };
18151 let mut __struct = Self::default();
18152 __struct.timestamp = buf.get_u64_le();
18153 __struct.last_heartbeat = buf.get_u64_le();
18154 __struct.failed_sessions = buf.get_u16_le();
18155 __struct.successful_sessions = buf.get_u16_le();
18156 __struct.signal_quality = buf.get_u8();
18157 __struct.ring_pending = buf.get_u8();
18158 __struct.tx_session_pending = buf.get_u8();
18159 __struct.rx_session_pending = buf.get_u8();
18160 Ok(__struct)
18161 }
18162 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18163 let mut __tmp = BytesMut::new(bytes);
18164 #[allow(clippy::absurd_extreme_comparisons)]
18165 #[allow(unused_comparisons)]
18166 if __tmp.remaining() < Self::ENCODED_LEN {
18167 panic!(
18168 "buffer is too small (need {} bytes, but got {})",
18169 Self::ENCODED_LEN,
18170 __tmp.remaining(),
18171 )
18172 }
18173 __tmp.put_u64_le(self.timestamp);
18174 __tmp.put_u64_le(self.last_heartbeat);
18175 __tmp.put_u16_le(self.failed_sessions);
18176 __tmp.put_u16_le(self.successful_sessions);
18177 __tmp.put_u8(self.signal_quality);
18178 __tmp.put_u8(self.ring_pending);
18179 __tmp.put_u8(self.tx_session_pending);
18180 __tmp.put_u8(self.rx_session_pending);
18181 if matches!(version, MavlinkVersion::V2) {
18182 let len = __tmp.len();
18183 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18184 } else {
18185 __tmp.len()
18186 }
18187 }
18188}
18189#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
18190#[doc = ""]
18191#[doc = "ID: 149"]
18192#[derive(Debug, Clone, PartialEq)]
18193#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18194#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18195#[cfg_attr(feature = "ts", derive(TS))]
18196#[cfg_attr(feature = "ts", ts(export))]
18197pub struct LANDING_TARGET_DATA {
18198 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18199 pub time_usec: u64,
18200 #[doc = "X-axis angular offset of the target from the center of the image"]
18201 pub angle_x: f32,
18202 #[doc = "Y-axis angular offset of the target from the center of the image"]
18203 pub angle_y: f32,
18204 #[doc = "Distance to the target from the vehicle"]
18205 pub distance: f32,
18206 #[doc = "Size of target along x-axis"]
18207 pub size_x: f32,
18208 #[doc = "Size of target along y-axis"]
18209 pub size_y: f32,
18210 #[doc = "The ID of the target if multiple targets are present"]
18211 pub target_num: u8,
18212 #[doc = "Coordinate frame used for following fields."]
18213 pub frame: MavFrame,
18214 #[doc = "X Position of the landing target in MAV_FRAME"]
18215 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18216 pub x: f32,
18217 #[doc = "Y Position of the landing target in MAV_FRAME"]
18218 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18219 pub y: f32,
18220 #[doc = "Z Position of the landing target in MAV_FRAME"]
18221 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18222 pub z: f32,
18223 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
18224 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18225 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18226 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18227 pub q: [f32; 4],
18228 #[doc = "Type of landing target"]
18229 #[cfg_attr(feature = "serde", serde(default))]
18230 pub mavtype: LandingTargetType,
18231 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
18232 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18233 pub position_valid: u8,
18234}
18235impl LANDING_TARGET_DATA {
18236 pub const ENCODED_LEN: usize = 60usize;
18237 pub const DEFAULT: Self = Self {
18238 time_usec: 0_u64,
18239 angle_x: 0.0_f32,
18240 angle_y: 0.0_f32,
18241 distance: 0.0_f32,
18242 size_x: 0.0_f32,
18243 size_y: 0.0_f32,
18244 target_num: 0_u8,
18245 frame: MavFrame::DEFAULT,
18246 x: 0.0_f32,
18247 y: 0.0_f32,
18248 z: 0.0_f32,
18249 q: [0.0_f32; 4usize],
18250 mavtype: LandingTargetType::DEFAULT,
18251 position_valid: 0_u8,
18252 };
18253 #[cfg(feature = "arbitrary")]
18254 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18255 use arbitrary::{Arbitrary, Unstructured};
18256 let mut buf = [0u8; 1024];
18257 rng.fill_bytes(&mut buf);
18258 let mut unstructured = Unstructured::new(&buf);
18259 Self::arbitrary(&mut unstructured).unwrap_or_default()
18260 }
18261}
18262impl Default for LANDING_TARGET_DATA {
18263 fn default() -> Self {
18264 Self::DEFAULT.clone()
18265 }
18266}
18267impl MessageData for LANDING_TARGET_DATA {
18268 type Message = MavMessage;
18269 const ID: u32 = 149u32;
18270 const NAME: &'static str = "LANDING_TARGET";
18271 const EXTRA_CRC: u8 = 200u8;
18272 const ENCODED_LEN: usize = 60usize;
18273 fn deser(
18274 _version: MavlinkVersion,
18275 __input: &[u8],
18276 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18277 let avail_len = __input.len();
18278 let mut payload_buf = [0; Self::ENCODED_LEN];
18279 let mut buf = if avail_len < Self::ENCODED_LEN {
18280 payload_buf[0..avail_len].copy_from_slice(__input);
18281 Bytes::new(&payload_buf)
18282 } else {
18283 Bytes::new(__input)
18284 };
18285 let mut __struct = Self::default();
18286 __struct.time_usec = buf.get_u64_le();
18287 __struct.angle_x = buf.get_f32_le();
18288 __struct.angle_y = buf.get_f32_le();
18289 __struct.distance = buf.get_f32_le();
18290 __struct.size_x = buf.get_f32_le();
18291 __struct.size_y = buf.get_f32_le();
18292 __struct.target_num = buf.get_u8();
18293 let tmp = buf.get_u8();
18294 __struct.frame =
18295 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18296 enum_type: "MavFrame",
18297 value: tmp as u32,
18298 })?;
18299 __struct.x = buf.get_f32_le();
18300 __struct.y = buf.get_f32_le();
18301 __struct.z = buf.get_f32_le();
18302 for v in &mut __struct.q {
18303 let val = buf.get_f32_le();
18304 *v = val;
18305 }
18306 let tmp = buf.get_u8();
18307 __struct.mavtype =
18308 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18309 enum_type: "LandingTargetType",
18310 value: tmp as u32,
18311 })?;
18312 __struct.position_valid = buf.get_u8();
18313 Ok(__struct)
18314 }
18315 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18316 let mut __tmp = BytesMut::new(bytes);
18317 #[allow(clippy::absurd_extreme_comparisons)]
18318 #[allow(unused_comparisons)]
18319 if __tmp.remaining() < Self::ENCODED_LEN {
18320 panic!(
18321 "buffer is too small (need {} bytes, but got {})",
18322 Self::ENCODED_LEN,
18323 __tmp.remaining(),
18324 )
18325 }
18326 __tmp.put_u64_le(self.time_usec);
18327 __tmp.put_f32_le(self.angle_x);
18328 __tmp.put_f32_le(self.angle_y);
18329 __tmp.put_f32_le(self.distance);
18330 __tmp.put_f32_le(self.size_x);
18331 __tmp.put_f32_le(self.size_y);
18332 __tmp.put_u8(self.target_num);
18333 __tmp.put_u8(self.frame as u8);
18334 if matches!(version, MavlinkVersion::V2) {
18335 __tmp.put_f32_le(self.x);
18336 __tmp.put_f32_le(self.y);
18337 __tmp.put_f32_le(self.z);
18338 for val in &self.q {
18339 __tmp.put_f32_le(*val);
18340 }
18341 __tmp.put_u8(self.mavtype as u8);
18342 __tmp.put_u8(self.position_valid);
18343 let len = __tmp.len();
18344 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18345 } else {
18346 __tmp.len()
18347 }
18348 }
18349}
18350#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
18351#[doc = ""]
18352#[doc = "ID: 8"]
18353#[derive(Debug, Clone, PartialEq)]
18354#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18355#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18356#[cfg_attr(feature = "ts", derive(TS))]
18357#[cfg_attr(feature = "ts", ts(export))]
18358pub struct LINK_NODE_STATUS_DATA {
18359 #[doc = "Timestamp (time since system boot)."]
18360 pub timestamp: u64,
18361 #[doc = "Transmit rate"]
18362 pub tx_rate: u32,
18363 #[doc = "Receive rate"]
18364 pub rx_rate: u32,
18365 #[doc = "Messages sent"]
18366 pub messages_sent: u32,
18367 #[doc = "Messages received (estimated from counting seq)"]
18368 pub messages_received: u32,
18369 #[doc = "Messages lost (estimated from counting seq)"]
18370 pub messages_lost: u32,
18371 #[doc = "Number of bytes that could not be parsed correctly."]
18372 pub rx_parse_err: u16,
18373 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
18374 pub tx_overflows: u16,
18375 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
18376 pub rx_overflows: u16,
18377 #[doc = "Remaining free transmit buffer space"]
18378 pub tx_buf: u8,
18379 #[doc = "Remaining free receive buffer space"]
18380 pub rx_buf: u8,
18381}
18382impl LINK_NODE_STATUS_DATA {
18383 pub const ENCODED_LEN: usize = 36usize;
18384 pub const DEFAULT: Self = Self {
18385 timestamp: 0_u64,
18386 tx_rate: 0_u32,
18387 rx_rate: 0_u32,
18388 messages_sent: 0_u32,
18389 messages_received: 0_u32,
18390 messages_lost: 0_u32,
18391 rx_parse_err: 0_u16,
18392 tx_overflows: 0_u16,
18393 rx_overflows: 0_u16,
18394 tx_buf: 0_u8,
18395 rx_buf: 0_u8,
18396 };
18397 #[cfg(feature = "arbitrary")]
18398 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18399 use arbitrary::{Arbitrary, Unstructured};
18400 let mut buf = [0u8; 1024];
18401 rng.fill_bytes(&mut buf);
18402 let mut unstructured = Unstructured::new(&buf);
18403 Self::arbitrary(&mut unstructured).unwrap_or_default()
18404 }
18405}
18406impl Default for LINK_NODE_STATUS_DATA {
18407 fn default() -> Self {
18408 Self::DEFAULT.clone()
18409 }
18410}
18411impl MessageData for LINK_NODE_STATUS_DATA {
18412 type Message = MavMessage;
18413 const ID: u32 = 8u32;
18414 const NAME: &'static str = "LINK_NODE_STATUS";
18415 const EXTRA_CRC: u8 = 117u8;
18416 const ENCODED_LEN: usize = 36usize;
18417 fn deser(
18418 _version: MavlinkVersion,
18419 __input: &[u8],
18420 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18421 let avail_len = __input.len();
18422 let mut payload_buf = [0; Self::ENCODED_LEN];
18423 let mut buf = if avail_len < Self::ENCODED_LEN {
18424 payload_buf[0..avail_len].copy_from_slice(__input);
18425 Bytes::new(&payload_buf)
18426 } else {
18427 Bytes::new(__input)
18428 };
18429 let mut __struct = Self::default();
18430 __struct.timestamp = buf.get_u64_le();
18431 __struct.tx_rate = buf.get_u32_le();
18432 __struct.rx_rate = buf.get_u32_le();
18433 __struct.messages_sent = buf.get_u32_le();
18434 __struct.messages_received = buf.get_u32_le();
18435 __struct.messages_lost = buf.get_u32_le();
18436 __struct.rx_parse_err = buf.get_u16_le();
18437 __struct.tx_overflows = buf.get_u16_le();
18438 __struct.rx_overflows = buf.get_u16_le();
18439 __struct.tx_buf = buf.get_u8();
18440 __struct.rx_buf = buf.get_u8();
18441 Ok(__struct)
18442 }
18443 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18444 let mut __tmp = BytesMut::new(bytes);
18445 #[allow(clippy::absurd_extreme_comparisons)]
18446 #[allow(unused_comparisons)]
18447 if __tmp.remaining() < Self::ENCODED_LEN {
18448 panic!(
18449 "buffer is too small (need {} bytes, but got {})",
18450 Self::ENCODED_LEN,
18451 __tmp.remaining(),
18452 )
18453 }
18454 __tmp.put_u64_le(self.timestamp);
18455 __tmp.put_u32_le(self.tx_rate);
18456 __tmp.put_u32_le(self.rx_rate);
18457 __tmp.put_u32_le(self.messages_sent);
18458 __tmp.put_u32_le(self.messages_received);
18459 __tmp.put_u32_le(self.messages_lost);
18460 __tmp.put_u16_le(self.rx_parse_err);
18461 __tmp.put_u16_le(self.tx_overflows);
18462 __tmp.put_u16_le(self.rx_overflows);
18463 __tmp.put_u8(self.tx_buf);
18464 __tmp.put_u8(self.rx_buf);
18465 if matches!(version, MavlinkVersion::V2) {
18466 let len = __tmp.len();
18467 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18468 } else {
18469 __tmp.len()
18470 }
18471 }
18472}
18473#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18474#[doc = ""]
18475#[doc = "ID: 32"]
18476#[derive(Debug, Clone, PartialEq)]
18477#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18479#[cfg_attr(feature = "ts", derive(TS))]
18480#[cfg_attr(feature = "ts", ts(export))]
18481pub struct LOCAL_POSITION_NED_DATA {
18482 #[doc = "Timestamp (time since system boot)."]
18483 pub time_boot_ms: u32,
18484 #[doc = "X Position"]
18485 pub x: f32,
18486 #[doc = "Y Position"]
18487 pub y: f32,
18488 #[doc = "Z Position"]
18489 pub z: f32,
18490 #[doc = "X Speed"]
18491 pub vx: f32,
18492 #[doc = "Y Speed"]
18493 pub vy: f32,
18494 #[doc = "Z Speed"]
18495 pub vz: f32,
18496}
18497impl LOCAL_POSITION_NED_DATA {
18498 pub const ENCODED_LEN: usize = 28usize;
18499 pub const DEFAULT: Self = Self {
18500 time_boot_ms: 0_u32,
18501 x: 0.0_f32,
18502 y: 0.0_f32,
18503 z: 0.0_f32,
18504 vx: 0.0_f32,
18505 vy: 0.0_f32,
18506 vz: 0.0_f32,
18507 };
18508 #[cfg(feature = "arbitrary")]
18509 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18510 use arbitrary::{Arbitrary, Unstructured};
18511 let mut buf = [0u8; 1024];
18512 rng.fill_bytes(&mut buf);
18513 let mut unstructured = Unstructured::new(&buf);
18514 Self::arbitrary(&mut unstructured).unwrap_or_default()
18515 }
18516}
18517impl Default for LOCAL_POSITION_NED_DATA {
18518 fn default() -> Self {
18519 Self::DEFAULT.clone()
18520 }
18521}
18522impl MessageData for LOCAL_POSITION_NED_DATA {
18523 type Message = MavMessage;
18524 const ID: u32 = 32u32;
18525 const NAME: &'static str = "LOCAL_POSITION_NED";
18526 const EXTRA_CRC: u8 = 185u8;
18527 const ENCODED_LEN: usize = 28usize;
18528 fn deser(
18529 _version: MavlinkVersion,
18530 __input: &[u8],
18531 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18532 let avail_len = __input.len();
18533 let mut payload_buf = [0; Self::ENCODED_LEN];
18534 let mut buf = if avail_len < Self::ENCODED_LEN {
18535 payload_buf[0..avail_len].copy_from_slice(__input);
18536 Bytes::new(&payload_buf)
18537 } else {
18538 Bytes::new(__input)
18539 };
18540 let mut __struct = Self::default();
18541 __struct.time_boot_ms = buf.get_u32_le();
18542 __struct.x = buf.get_f32_le();
18543 __struct.y = buf.get_f32_le();
18544 __struct.z = buf.get_f32_le();
18545 __struct.vx = buf.get_f32_le();
18546 __struct.vy = buf.get_f32_le();
18547 __struct.vz = buf.get_f32_le();
18548 Ok(__struct)
18549 }
18550 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18551 let mut __tmp = BytesMut::new(bytes);
18552 #[allow(clippy::absurd_extreme_comparisons)]
18553 #[allow(unused_comparisons)]
18554 if __tmp.remaining() < Self::ENCODED_LEN {
18555 panic!(
18556 "buffer is too small (need {} bytes, but got {})",
18557 Self::ENCODED_LEN,
18558 __tmp.remaining(),
18559 )
18560 }
18561 __tmp.put_u32_le(self.time_boot_ms);
18562 __tmp.put_f32_le(self.x);
18563 __tmp.put_f32_le(self.y);
18564 __tmp.put_f32_le(self.z);
18565 __tmp.put_f32_le(self.vx);
18566 __tmp.put_f32_le(self.vy);
18567 __tmp.put_f32_le(self.vz);
18568 if matches!(version, MavlinkVersion::V2) {
18569 let len = __tmp.len();
18570 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18571 } else {
18572 __tmp.len()
18573 }
18574 }
18575}
18576#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18577#[doc = ""]
18578#[doc = "ID: 64"]
18579#[derive(Debug, Clone, PartialEq)]
18580#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18581#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18582#[cfg_attr(feature = "ts", derive(TS))]
18583#[cfg_attr(feature = "ts", ts(export))]
18584pub struct LOCAL_POSITION_NED_COV_DATA {
18585 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18586 pub time_usec: u64,
18587 #[doc = "X Position"]
18588 pub x: f32,
18589 #[doc = "Y Position"]
18590 pub y: f32,
18591 #[doc = "Z Position"]
18592 pub z: f32,
18593 #[doc = "X Speed"]
18594 pub vx: f32,
18595 #[doc = "Y Speed"]
18596 pub vy: f32,
18597 #[doc = "Z Speed"]
18598 pub vz: f32,
18599 #[doc = "X Acceleration"]
18600 pub ax: f32,
18601 #[doc = "Y Acceleration"]
18602 pub ay: f32,
18603 #[doc = "Z Acceleration"]
18604 pub az: f32,
18605 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
18606 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18607 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18608 pub covariance: [f32; 45],
18609 #[doc = "Class id of the estimator this estimate originated from."]
18610 pub estimator_type: MavEstimatorType,
18611}
18612impl LOCAL_POSITION_NED_COV_DATA {
18613 pub const ENCODED_LEN: usize = 225usize;
18614 pub const DEFAULT: Self = Self {
18615 time_usec: 0_u64,
18616 x: 0.0_f32,
18617 y: 0.0_f32,
18618 z: 0.0_f32,
18619 vx: 0.0_f32,
18620 vy: 0.0_f32,
18621 vz: 0.0_f32,
18622 ax: 0.0_f32,
18623 ay: 0.0_f32,
18624 az: 0.0_f32,
18625 covariance: [0.0_f32; 45usize],
18626 estimator_type: MavEstimatorType::DEFAULT,
18627 };
18628 #[cfg(feature = "arbitrary")]
18629 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18630 use arbitrary::{Arbitrary, Unstructured};
18631 let mut buf = [0u8; 1024];
18632 rng.fill_bytes(&mut buf);
18633 let mut unstructured = Unstructured::new(&buf);
18634 Self::arbitrary(&mut unstructured).unwrap_or_default()
18635 }
18636}
18637impl Default for LOCAL_POSITION_NED_COV_DATA {
18638 fn default() -> Self {
18639 Self::DEFAULT.clone()
18640 }
18641}
18642impl MessageData for LOCAL_POSITION_NED_COV_DATA {
18643 type Message = MavMessage;
18644 const ID: u32 = 64u32;
18645 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
18646 const EXTRA_CRC: u8 = 191u8;
18647 const ENCODED_LEN: usize = 225usize;
18648 fn deser(
18649 _version: MavlinkVersion,
18650 __input: &[u8],
18651 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18652 let avail_len = __input.len();
18653 let mut payload_buf = [0; Self::ENCODED_LEN];
18654 let mut buf = if avail_len < Self::ENCODED_LEN {
18655 payload_buf[0..avail_len].copy_from_slice(__input);
18656 Bytes::new(&payload_buf)
18657 } else {
18658 Bytes::new(__input)
18659 };
18660 let mut __struct = Self::default();
18661 __struct.time_usec = buf.get_u64_le();
18662 __struct.x = buf.get_f32_le();
18663 __struct.y = buf.get_f32_le();
18664 __struct.z = buf.get_f32_le();
18665 __struct.vx = buf.get_f32_le();
18666 __struct.vy = buf.get_f32_le();
18667 __struct.vz = buf.get_f32_le();
18668 __struct.ax = buf.get_f32_le();
18669 __struct.ay = buf.get_f32_le();
18670 __struct.az = buf.get_f32_le();
18671 for v in &mut __struct.covariance {
18672 let val = buf.get_f32_le();
18673 *v = val;
18674 }
18675 let tmp = buf.get_u8();
18676 __struct.estimator_type =
18677 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18678 enum_type: "MavEstimatorType",
18679 value: tmp as u32,
18680 })?;
18681 Ok(__struct)
18682 }
18683 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18684 let mut __tmp = BytesMut::new(bytes);
18685 #[allow(clippy::absurd_extreme_comparisons)]
18686 #[allow(unused_comparisons)]
18687 if __tmp.remaining() < Self::ENCODED_LEN {
18688 panic!(
18689 "buffer is too small (need {} bytes, but got {})",
18690 Self::ENCODED_LEN,
18691 __tmp.remaining(),
18692 )
18693 }
18694 __tmp.put_u64_le(self.time_usec);
18695 __tmp.put_f32_le(self.x);
18696 __tmp.put_f32_le(self.y);
18697 __tmp.put_f32_le(self.z);
18698 __tmp.put_f32_le(self.vx);
18699 __tmp.put_f32_le(self.vy);
18700 __tmp.put_f32_le(self.vz);
18701 __tmp.put_f32_le(self.ax);
18702 __tmp.put_f32_le(self.ay);
18703 __tmp.put_f32_le(self.az);
18704 for val in &self.covariance {
18705 __tmp.put_f32_le(*val);
18706 }
18707 __tmp.put_u8(self.estimator_type as u8);
18708 if matches!(version, MavlinkVersion::V2) {
18709 let len = __tmp.len();
18710 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18711 } else {
18712 __tmp.len()
18713 }
18714 }
18715}
18716#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18717#[doc = ""]
18718#[doc = "ID: 89"]
18719#[derive(Debug, Clone, PartialEq)]
18720#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18721#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18722#[cfg_attr(feature = "ts", derive(TS))]
18723#[cfg_attr(feature = "ts", ts(export))]
18724pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18725 #[doc = "Timestamp (time since system boot)."]
18726 pub time_boot_ms: u32,
18727 #[doc = "X Position"]
18728 pub x: f32,
18729 #[doc = "Y Position"]
18730 pub y: f32,
18731 #[doc = "Z Position"]
18732 pub z: f32,
18733 #[doc = "Roll"]
18734 pub roll: f32,
18735 #[doc = "Pitch"]
18736 pub pitch: f32,
18737 #[doc = "Yaw"]
18738 pub yaw: f32,
18739}
18740impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18741 pub const ENCODED_LEN: usize = 28usize;
18742 pub const DEFAULT: Self = Self {
18743 time_boot_ms: 0_u32,
18744 x: 0.0_f32,
18745 y: 0.0_f32,
18746 z: 0.0_f32,
18747 roll: 0.0_f32,
18748 pitch: 0.0_f32,
18749 yaw: 0.0_f32,
18750 };
18751 #[cfg(feature = "arbitrary")]
18752 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18753 use arbitrary::{Arbitrary, Unstructured};
18754 let mut buf = [0u8; 1024];
18755 rng.fill_bytes(&mut buf);
18756 let mut unstructured = Unstructured::new(&buf);
18757 Self::arbitrary(&mut unstructured).unwrap_or_default()
18758 }
18759}
18760impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18761 fn default() -> Self {
18762 Self::DEFAULT.clone()
18763 }
18764}
18765impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18766 type Message = MavMessage;
18767 const ID: u32 = 89u32;
18768 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
18769 const EXTRA_CRC: u8 = 231u8;
18770 const ENCODED_LEN: usize = 28usize;
18771 fn deser(
18772 _version: MavlinkVersion,
18773 __input: &[u8],
18774 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18775 let avail_len = __input.len();
18776 let mut payload_buf = [0; Self::ENCODED_LEN];
18777 let mut buf = if avail_len < Self::ENCODED_LEN {
18778 payload_buf[0..avail_len].copy_from_slice(__input);
18779 Bytes::new(&payload_buf)
18780 } else {
18781 Bytes::new(__input)
18782 };
18783 let mut __struct = Self::default();
18784 __struct.time_boot_ms = buf.get_u32_le();
18785 __struct.x = buf.get_f32_le();
18786 __struct.y = buf.get_f32_le();
18787 __struct.z = buf.get_f32_le();
18788 __struct.roll = buf.get_f32_le();
18789 __struct.pitch = buf.get_f32_le();
18790 __struct.yaw = buf.get_f32_le();
18791 Ok(__struct)
18792 }
18793 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18794 let mut __tmp = BytesMut::new(bytes);
18795 #[allow(clippy::absurd_extreme_comparisons)]
18796 #[allow(unused_comparisons)]
18797 if __tmp.remaining() < Self::ENCODED_LEN {
18798 panic!(
18799 "buffer is too small (need {} bytes, but got {})",
18800 Self::ENCODED_LEN,
18801 __tmp.remaining(),
18802 )
18803 }
18804 __tmp.put_u32_le(self.time_boot_ms);
18805 __tmp.put_f32_le(self.x);
18806 __tmp.put_f32_le(self.y);
18807 __tmp.put_f32_le(self.z);
18808 __tmp.put_f32_le(self.roll);
18809 __tmp.put_f32_le(self.pitch);
18810 __tmp.put_f32_le(self.yaw);
18811 if matches!(version, MavlinkVersion::V2) {
18812 let len = __tmp.len();
18813 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18814 } else {
18815 __tmp.len()
18816 }
18817 }
18818}
18819#[doc = "An ack for a LOGGING_DATA_ACKED message."]
18820#[doc = ""]
18821#[doc = "ID: 268"]
18822#[derive(Debug, Clone, PartialEq)]
18823#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18824#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18825#[cfg_attr(feature = "ts", derive(TS))]
18826#[cfg_attr(feature = "ts", ts(export))]
18827pub struct LOGGING_ACK_DATA {
18828 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
18829 pub sequence: u16,
18830 #[doc = "system ID of the target"]
18831 pub target_system: u8,
18832 #[doc = "component ID of the target"]
18833 pub target_component: u8,
18834}
18835impl LOGGING_ACK_DATA {
18836 pub const ENCODED_LEN: usize = 4usize;
18837 pub const DEFAULT: Self = Self {
18838 sequence: 0_u16,
18839 target_system: 0_u8,
18840 target_component: 0_u8,
18841 };
18842 #[cfg(feature = "arbitrary")]
18843 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18844 use arbitrary::{Arbitrary, Unstructured};
18845 let mut buf = [0u8; 1024];
18846 rng.fill_bytes(&mut buf);
18847 let mut unstructured = Unstructured::new(&buf);
18848 Self::arbitrary(&mut unstructured).unwrap_or_default()
18849 }
18850}
18851impl Default for LOGGING_ACK_DATA {
18852 fn default() -> Self {
18853 Self::DEFAULT.clone()
18854 }
18855}
18856impl MessageData for LOGGING_ACK_DATA {
18857 type Message = MavMessage;
18858 const ID: u32 = 268u32;
18859 const NAME: &'static str = "LOGGING_ACK";
18860 const EXTRA_CRC: u8 = 14u8;
18861 const ENCODED_LEN: usize = 4usize;
18862 fn deser(
18863 _version: MavlinkVersion,
18864 __input: &[u8],
18865 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18866 let avail_len = __input.len();
18867 let mut payload_buf = [0; Self::ENCODED_LEN];
18868 let mut buf = if avail_len < Self::ENCODED_LEN {
18869 payload_buf[0..avail_len].copy_from_slice(__input);
18870 Bytes::new(&payload_buf)
18871 } else {
18872 Bytes::new(__input)
18873 };
18874 let mut __struct = Self::default();
18875 __struct.sequence = buf.get_u16_le();
18876 __struct.target_system = buf.get_u8();
18877 __struct.target_component = buf.get_u8();
18878 Ok(__struct)
18879 }
18880 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18881 let mut __tmp = BytesMut::new(bytes);
18882 #[allow(clippy::absurd_extreme_comparisons)]
18883 #[allow(unused_comparisons)]
18884 if __tmp.remaining() < Self::ENCODED_LEN {
18885 panic!(
18886 "buffer is too small (need {} bytes, but got {})",
18887 Self::ENCODED_LEN,
18888 __tmp.remaining(),
18889 )
18890 }
18891 __tmp.put_u16_le(self.sequence);
18892 __tmp.put_u8(self.target_system);
18893 __tmp.put_u8(self.target_component);
18894 if matches!(version, MavlinkVersion::V2) {
18895 let len = __tmp.len();
18896 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18897 } else {
18898 __tmp.len()
18899 }
18900 }
18901}
18902#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
18903#[doc = ""]
18904#[doc = "ID: 266"]
18905#[derive(Debug, Clone, PartialEq)]
18906#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18907#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18908#[cfg_attr(feature = "ts", derive(TS))]
18909#[cfg_attr(feature = "ts", ts(export))]
18910pub struct LOGGING_DATA_DATA {
18911 #[doc = "sequence number (can wrap)"]
18912 pub sequence: u16,
18913 #[doc = "system ID of the target"]
18914 pub target_system: u8,
18915 #[doc = "component ID of the target"]
18916 pub target_component: u8,
18917 #[doc = "data length"]
18918 pub length: u8,
18919 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18920 pub first_message_offset: u8,
18921 #[doc = "logged data"]
18922 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18923 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18924 pub data: [u8; 249],
18925}
18926impl LOGGING_DATA_DATA {
18927 pub const ENCODED_LEN: usize = 255usize;
18928 pub const DEFAULT: Self = Self {
18929 sequence: 0_u16,
18930 target_system: 0_u8,
18931 target_component: 0_u8,
18932 length: 0_u8,
18933 first_message_offset: 0_u8,
18934 data: [0_u8; 249usize],
18935 };
18936 #[cfg(feature = "arbitrary")]
18937 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18938 use arbitrary::{Arbitrary, Unstructured};
18939 let mut buf = [0u8; 1024];
18940 rng.fill_bytes(&mut buf);
18941 let mut unstructured = Unstructured::new(&buf);
18942 Self::arbitrary(&mut unstructured).unwrap_or_default()
18943 }
18944}
18945impl Default for LOGGING_DATA_DATA {
18946 fn default() -> Self {
18947 Self::DEFAULT.clone()
18948 }
18949}
18950impl MessageData for LOGGING_DATA_DATA {
18951 type Message = MavMessage;
18952 const ID: u32 = 266u32;
18953 const NAME: &'static str = "LOGGING_DATA";
18954 const EXTRA_CRC: u8 = 193u8;
18955 const ENCODED_LEN: usize = 255usize;
18956 fn deser(
18957 _version: MavlinkVersion,
18958 __input: &[u8],
18959 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18960 let avail_len = __input.len();
18961 let mut payload_buf = [0; Self::ENCODED_LEN];
18962 let mut buf = if avail_len < Self::ENCODED_LEN {
18963 payload_buf[0..avail_len].copy_from_slice(__input);
18964 Bytes::new(&payload_buf)
18965 } else {
18966 Bytes::new(__input)
18967 };
18968 let mut __struct = Self::default();
18969 __struct.sequence = buf.get_u16_le();
18970 __struct.target_system = buf.get_u8();
18971 __struct.target_component = buf.get_u8();
18972 __struct.length = buf.get_u8();
18973 __struct.first_message_offset = buf.get_u8();
18974 for v in &mut __struct.data {
18975 let val = buf.get_u8();
18976 *v = val;
18977 }
18978 Ok(__struct)
18979 }
18980 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18981 let mut __tmp = BytesMut::new(bytes);
18982 #[allow(clippy::absurd_extreme_comparisons)]
18983 #[allow(unused_comparisons)]
18984 if __tmp.remaining() < Self::ENCODED_LEN {
18985 panic!(
18986 "buffer is too small (need {} bytes, but got {})",
18987 Self::ENCODED_LEN,
18988 __tmp.remaining(),
18989 )
18990 }
18991 __tmp.put_u16_le(self.sequence);
18992 __tmp.put_u8(self.target_system);
18993 __tmp.put_u8(self.target_component);
18994 __tmp.put_u8(self.length);
18995 __tmp.put_u8(self.first_message_offset);
18996 for val in &self.data {
18997 __tmp.put_u8(*val);
18998 }
18999 if matches!(version, MavlinkVersion::V2) {
19000 let len = __tmp.len();
19001 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19002 } else {
19003 __tmp.len()
19004 }
19005 }
19006}
19007#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
19008#[doc = ""]
19009#[doc = "ID: 267"]
19010#[derive(Debug, Clone, PartialEq)]
19011#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19013#[cfg_attr(feature = "ts", derive(TS))]
19014#[cfg_attr(feature = "ts", ts(export))]
19015pub struct LOGGING_DATA_ACKED_DATA {
19016 #[doc = "sequence number (can wrap)"]
19017 pub sequence: u16,
19018 #[doc = "system ID of the target"]
19019 pub target_system: u8,
19020 #[doc = "component ID of the target"]
19021 pub target_component: u8,
19022 #[doc = "data length"]
19023 pub length: u8,
19024 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
19025 pub first_message_offset: u8,
19026 #[doc = "logged data"]
19027 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19028 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19029 pub data: [u8; 249],
19030}
19031impl LOGGING_DATA_ACKED_DATA {
19032 pub const ENCODED_LEN: usize = 255usize;
19033 pub const DEFAULT: Self = Self {
19034 sequence: 0_u16,
19035 target_system: 0_u8,
19036 target_component: 0_u8,
19037 length: 0_u8,
19038 first_message_offset: 0_u8,
19039 data: [0_u8; 249usize],
19040 };
19041 #[cfg(feature = "arbitrary")]
19042 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19043 use arbitrary::{Arbitrary, Unstructured};
19044 let mut buf = [0u8; 1024];
19045 rng.fill_bytes(&mut buf);
19046 let mut unstructured = Unstructured::new(&buf);
19047 Self::arbitrary(&mut unstructured).unwrap_or_default()
19048 }
19049}
19050impl Default for LOGGING_DATA_ACKED_DATA {
19051 fn default() -> Self {
19052 Self::DEFAULT.clone()
19053 }
19054}
19055impl MessageData for LOGGING_DATA_ACKED_DATA {
19056 type Message = MavMessage;
19057 const ID: u32 = 267u32;
19058 const NAME: &'static str = "LOGGING_DATA_ACKED";
19059 const EXTRA_CRC: u8 = 35u8;
19060 const ENCODED_LEN: usize = 255usize;
19061 fn deser(
19062 _version: MavlinkVersion,
19063 __input: &[u8],
19064 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19065 let avail_len = __input.len();
19066 let mut payload_buf = [0; Self::ENCODED_LEN];
19067 let mut buf = if avail_len < Self::ENCODED_LEN {
19068 payload_buf[0..avail_len].copy_from_slice(__input);
19069 Bytes::new(&payload_buf)
19070 } else {
19071 Bytes::new(__input)
19072 };
19073 let mut __struct = Self::default();
19074 __struct.sequence = buf.get_u16_le();
19075 __struct.target_system = buf.get_u8();
19076 __struct.target_component = buf.get_u8();
19077 __struct.length = buf.get_u8();
19078 __struct.first_message_offset = buf.get_u8();
19079 for v in &mut __struct.data {
19080 let val = buf.get_u8();
19081 *v = val;
19082 }
19083 Ok(__struct)
19084 }
19085 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19086 let mut __tmp = BytesMut::new(bytes);
19087 #[allow(clippy::absurd_extreme_comparisons)]
19088 #[allow(unused_comparisons)]
19089 if __tmp.remaining() < Self::ENCODED_LEN {
19090 panic!(
19091 "buffer is too small (need {} bytes, but got {})",
19092 Self::ENCODED_LEN,
19093 __tmp.remaining(),
19094 )
19095 }
19096 __tmp.put_u16_le(self.sequence);
19097 __tmp.put_u8(self.target_system);
19098 __tmp.put_u8(self.target_component);
19099 __tmp.put_u8(self.length);
19100 __tmp.put_u8(self.first_message_offset);
19101 for val in &self.data {
19102 __tmp.put_u8(*val);
19103 }
19104 if matches!(version, MavlinkVersion::V2) {
19105 let len = __tmp.len();
19106 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19107 } else {
19108 __tmp.len()
19109 }
19110 }
19111}
19112#[doc = "Reply to LOG_REQUEST_DATA."]
19113#[doc = ""]
19114#[doc = "ID: 120"]
19115#[derive(Debug, Clone, PartialEq)]
19116#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19117#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19118#[cfg_attr(feature = "ts", derive(TS))]
19119#[cfg_attr(feature = "ts", ts(export))]
19120pub struct LOG_DATA_DATA {
19121 #[doc = "Offset into the log"]
19122 pub ofs: u32,
19123 #[doc = "Log id (from LOG_ENTRY reply)"]
19124 pub id: u16,
19125 #[doc = "Number of bytes (zero for end of log)"]
19126 pub count: u8,
19127 #[doc = "log data"]
19128 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19129 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19130 pub data: [u8; 90],
19131}
19132impl LOG_DATA_DATA {
19133 pub const ENCODED_LEN: usize = 97usize;
19134 pub const DEFAULT: Self = Self {
19135 ofs: 0_u32,
19136 id: 0_u16,
19137 count: 0_u8,
19138 data: [0_u8; 90usize],
19139 };
19140 #[cfg(feature = "arbitrary")]
19141 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19142 use arbitrary::{Arbitrary, Unstructured};
19143 let mut buf = [0u8; 1024];
19144 rng.fill_bytes(&mut buf);
19145 let mut unstructured = Unstructured::new(&buf);
19146 Self::arbitrary(&mut unstructured).unwrap_or_default()
19147 }
19148}
19149impl Default for LOG_DATA_DATA {
19150 fn default() -> Self {
19151 Self::DEFAULT.clone()
19152 }
19153}
19154impl MessageData for LOG_DATA_DATA {
19155 type Message = MavMessage;
19156 const ID: u32 = 120u32;
19157 const NAME: &'static str = "LOG_DATA";
19158 const EXTRA_CRC: u8 = 134u8;
19159 const ENCODED_LEN: usize = 97usize;
19160 fn deser(
19161 _version: MavlinkVersion,
19162 __input: &[u8],
19163 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19164 let avail_len = __input.len();
19165 let mut payload_buf = [0; Self::ENCODED_LEN];
19166 let mut buf = if avail_len < Self::ENCODED_LEN {
19167 payload_buf[0..avail_len].copy_from_slice(__input);
19168 Bytes::new(&payload_buf)
19169 } else {
19170 Bytes::new(__input)
19171 };
19172 let mut __struct = Self::default();
19173 __struct.ofs = buf.get_u32_le();
19174 __struct.id = buf.get_u16_le();
19175 __struct.count = buf.get_u8();
19176 for v in &mut __struct.data {
19177 let val = buf.get_u8();
19178 *v = val;
19179 }
19180 Ok(__struct)
19181 }
19182 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19183 let mut __tmp = BytesMut::new(bytes);
19184 #[allow(clippy::absurd_extreme_comparisons)]
19185 #[allow(unused_comparisons)]
19186 if __tmp.remaining() < Self::ENCODED_LEN {
19187 panic!(
19188 "buffer is too small (need {} bytes, but got {})",
19189 Self::ENCODED_LEN,
19190 __tmp.remaining(),
19191 )
19192 }
19193 __tmp.put_u32_le(self.ofs);
19194 __tmp.put_u16_le(self.id);
19195 __tmp.put_u8(self.count);
19196 for val in &self.data {
19197 __tmp.put_u8(*val);
19198 }
19199 if matches!(version, MavlinkVersion::V2) {
19200 let len = __tmp.len();
19201 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19202 } else {
19203 __tmp.len()
19204 }
19205 }
19206}
19207#[doc = "Reply to LOG_REQUEST_LIST."]
19208#[doc = ""]
19209#[doc = "ID: 118"]
19210#[derive(Debug, Clone, PartialEq)]
19211#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19212#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19213#[cfg_attr(feature = "ts", derive(TS))]
19214#[cfg_attr(feature = "ts", ts(export))]
19215pub struct LOG_ENTRY_DATA {
19216 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
19217 pub time_utc: u32,
19218 #[doc = "Size of the log (may be approximate)"]
19219 pub size: u32,
19220 #[doc = "Log id"]
19221 pub id: u16,
19222 #[doc = "Total number of logs"]
19223 pub num_logs: u16,
19224 #[doc = "High log number"]
19225 pub last_log_num: u16,
19226}
19227impl LOG_ENTRY_DATA {
19228 pub const ENCODED_LEN: usize = 14usize;
19229 pub const DEFAULT: Self = Self {
19230 time_utc: 0_u32,
19231 size: 0_u32,
19232 id: 0_u16,
19233 num_logs: 0_u16,
19234 last_log_num: 0_u16,
19235 };
19236 #[cfg(feature = "arbitrary")]
19237 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19238 use arbitrary::{Arbitrary, Unstructured};
19239 let mut buf = [0u8; 1024];
19240 rng.fill_bytes(&mut buf);
19241 let mut unstructured = Unstructured::new(&buf);
19242 Self::arbitrary(&mut unstructured).unwrap_or_default()
19243 }
19244}
19245impl Default for LOG_ENTRY_DATA {
19246 fn default() -> Self {
19247 Self::DEFAULT.clone()
19248 }
19249}
19250impl MessageData for LOG_ENTRY_DATA {
19251 type Message = MavMessage;
19252 const ID: u32 = 118u32;
19253 const NAME: &'static str = "LOG_ENTRY";
19254 const EXTRA_CRC: u8 = 56u8;
19255 const ENCODED_LEN: usize = 14usize;
19256 fn deser(
19257 _version: MavlinkVersion,
19258 __input: &[u8],
19259 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19260 let avail_len = __input.len();
19261 let mut payload_buf = [0; Self::ENCODED_LEN];
19262 let mut buf = if avail_len < Self::ENCODED_LEN {
19263 payload_buf[0..avail_len].copy_from_slice(__input);
19264 Bytes::new(&payload_buf)
19265 } else {
19266 Bytes::new(__input)
19267 };
19268 let mut __struct = Self::default();
19269 __struct.time_utc = buf.get_u32_le();
19270 __struct.size = buf.get_u32_le();
19271 __struct.id = buf.get_u16_le();
19272 __struct.num_logs = buf.get_u16_le();
19273 __struct.last_log_num = buf.get_u16_le();
19274 Ok(__struct)
19275 }
19276 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19277 let mut __tmp = BytesMut::new(bytes);
19278 #[allow(clippy::absurd_extreme_comparisons)]
19279 #[allow(unused_comparisons)]
19280 if __tmp.remaining() < Self::ENCODED_LEN {
19281 panic!(
19282 "buffer is too small (need {} bytes, but got {})",
19283 Self::ENCODED_LEN,
19284 __tmp.remaining(),
19285 )
19286 }
19287 __tmp.put_u32_le(self.time_utc);
19288 __tmp.put_u32_le(self.size);
19289 __tmp.put_u16_le(self.id);
19290 __tmp.put_u16_le(self.num_logs);
19291 __tmp.put_u16_le(self.last_log_num);
19292 if matches!(version, MavlinkVersion::V2) {
19293 let len = __tmp.len();
19294 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19295 } else {
19296 __tmp.len()
19297 }
19298 }
19299}
19300#[doc = "Erase all logs."]
19301#[doc = ""]
19302#[doc = "ID: 121"]
19303#[derive(Debug, Clone, PartialEq)]
19304#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19305#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19306#[cfg_attr(feature = "ts", derive(TS))]
19307#[cfg_attr(feature = "ts", ts(export))]
19308pub struct LOG_ERASE_DATA {
19309 #[doc = "System ID"]
19310 pub target_system: u8,
19311 #[doc = "Component ID"]
19312 pub target_component: u8,
19313}
19314impl LOG_ERASE_DATA {
19315 pub const ENCODED_LEN: usize = 2usize;
19316 pub const DEFAULT: Self = Self {
19317 target_system: 0_u8,
19318 target_component: 0_u8,
19319 };
19320 #[cfg(feature = "arbitrary")]
19321 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19322 use arbitrary::{Arbitrary, Unstructured};
19323 let mut buf = [0u8; 1024];
19324 rng.fill_bytes(&mut buf);
19325 let mut unstructured = Unstructured::new(&buf);
19326 Self::arbitrary(&mut unstructured).unwrap_or_default()
19327 }
19328}
19329impl Default for LOG_ERASE_DATA {
19330 fn default() -> Self {
19331 Self::DEFAULT.clone()
19332 }
19333}
19334impl MessageData for LOG_ERASE_DATA {
19335 type Message = MavMessage;
19336 const ID: u32 = 121u32;
19337 const NAME: &'static str = "LOG_ERASE";
19338 const EXTRA_CRC: u8 = 237u8;
19339 const ENCODED_LEN: usize = 2usize;
19340 fn deser(
19341 _version: MavlinkVersion,
19342 __input: &[u8],
19343 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19344 let avail_len = __input.len();
19345 let mut payload_buf = [0; Self::ENCODED_LEN];
19346 let mut buf = if avail_len < Self::ENCODED_LEN {
19347 payload_buf[0..avail_len].copy_from_slice(__input);
19348 Bytes::new(&payload_buf)
19349 } else {
19350 Bytes::new(__input)
19351 };
19352 let mut __struct = Self::default();
19353 __struct.target_system = buf.get_u8();
19354 __struct.target_component = buf.get_u8();
19355 Ok(__struct)
19356 }
19357 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19358 let mut __tmp = BytesMut::new(bytes);
19359 #[allow(clippy::absurd_extreme_comparisons)]
19360 #[allow(unused_comparisons)]
19361 if __tmp.remaining() < Self::ENCODED_LEN {
19362 panic!(
19363 "buffer is too small (need {} bytes, but got {})",
19364 Self::ENCODED_LEN,
19365 __tmp.remaining(),
19366 )
19367 }
19368 __tmp.put_u8(self.target_system);
19369 __tmp.put_u8(self.target_component);
19370 if matches!(version, MavlinkVersion::V2) {
19371 let len = __tmp.len();
19372 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19373 } else {
19374 __tmp.len()
19375 }
19376 }
19377}
19378#[doc = "Request a chunk of a log."]
19379#[doc = ""]
19380#[doc = "ID: 119"]
19381#[derive(Debug, Clone, PartialEq)]
19382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19384#[cfg_attr(feature = "ts", derive(TS))]
19385#[cfg_attr(feature = "ts", ts(export))]
19386pub struct LOG_REQUEST_DATA_DATA {
19387 #[doc = "Offset into the log"]
19388 pub ofs: u32,
19389 #[doc = "Number of bytes"]
19390 pub count: u32,
19391 #[doc = "Log id (from LOG_ENTRY reply)"]
19392 pub id: u16,
19393 #[doc = "System ID"]
19394 pub target_system: u8,
19395 #[doc = "Component ID"]
19396 pub target_component: u8,
19397}
19398impl LOG_REQUEST_DATA_DATA {
19399 pub const ENCODED_LEN: usize = 12usize;
19400 pub const DEFAULT: Self = Self {
19401 ofs: 0_u32,
19402 count: 0_u32,
19403 id: 0_u16,
19404 target_system: 0_u8,
19405 target_component: 0_u8,
19406 };
19407 #[cfg(feature = "arbitrary")]
19408 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19409 use arbitrary::{Arbitrary, Unstructured};
19410 let mut buf = [0u8; 1024];
19411 rng.fill_bytes(&mut buf);
19412 let mut unstructured = Unstructured::new(&buf);
19413 Self::arbitrary(&mut unstructured).unwrap_or_default()
19414 }
19415}
19416impl Default for LOG_REQUEST_DATA_DATA {
19417 fn default() -> Self {
19418 Self::DEFAULT.clone()
19419 }
19420}
19421impl MessageData for LOG_REQUEST_DATA_DATA {
19422 type Message = MavMessage;
19423 const ID: u32 = 119u32;
19424 const NAME: &'static str = "LOG_REQUEST_DATA";
19425 const EXTRA_CRC: u8 = 116u8;
19426 const ENCODED_LEN: usize = 12usize;
19427 fn deser(
19428 _version: MavlinkVersion,
19429 __input: &[u8],
19430 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19431 let avail_len = __input.len();
19432 let mut payload_buf = [0; Self::ENCODED_LEN];
19433 let mut buf = if avail_len < Self::ENCODED_LEN {
19434 payload_buf[0..avail_len].copy_from_slice(__input);
19435 Bytes::new(&payload_buf)
19436 } else {
19437 Bytes::new(__input)
19438 };
19439 let mut __struct = Self::default();
19440 __struct.ofs = buf.get_u32_le();
19441 __struct.count = buf.get_u32_le();
19442 __struct.id = buf.get_u16_le();
19443 __struct.target_system = buf.get_u8();
19444 __struct.target_component = buf.get_u8();
19445 Ok(__struct)
19446 }
19447 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19448 let mut __tmp = BytesMut::new(bytes);
19449 #[allow(clippy::absurd_extreme_comparisons)]
19450 #[allow(unused_comparisons)]
19451 if __tmp.remaining() < Self::ENCODED_LEN {
19452 panic!(
19453 "buffer is too small (need {} bytes, but got {})",
19454 Self::ENCODED_LEN,
19455 __tmp.remaining(),
19456 )
19457 }
19458 __tmp.put_u32_le(self.ofs);
19459 __tmp.put_u32_le(self.count);
19460 __tmp.put_u16_le(self.id);
19461 __tmp.put_u8(self.target_system);
19462 __tmp.put_u8(self.target_component);
19463 if matches!(version, MavlinkVersion::V2) {
19464 let len = __tmp.len();
19465 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19466 } else {
19467 __tmp.len()
19468 }
19469 }
19470}
19471#[doc = "Stop log transfer and resume normal logging."]
19472#[doc = ""]
19473#[doc = "ID: 122"]
19474#[derive(Debug, Clone, PartialEq)]
19475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19476#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19477#[cfg_attr(feature = "ts", derive(TS))]
19478#[cfg_attr(feature = "ts", ts(export))]
19479pub struct LOG_REQUEST_END_DATA {
19480 #[doc = "System ID"]
19481 pub target_system: u8,
19482 #[doc = "Component ID"]
19483 pub target_component: u8,
19484}
19485impl LOG_REQUEST_END_DATA {
19486 pub const ENCODED_LEN: usize = 2usize;
19487 pub const DEFAULT: Self = Self {
19488 target_system: 0_u8,
19489 target_component: 0_u8,
19490 };
19491 #[cfg(feature = "arbitrary")]
19492 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19493 use arbitrary::{Arbitrary, Unstructured};
19494 let mut buf = [0u8; 1024];
19495 rng.fill_bytes(&mut buf);
19496 let mut unstructured = Unstructured::new(&buf);
19497 Self::arbitrary(&mut unstructured).unwrap_or_default()
19498 }
19499}
19500impl Default for LOG_REQUEST_END_DATA {
19501 fn default() -> Self {
19502 Self::DEFAULT.clone()
19503 }
19504}
19505impl MessageData for LOG_REQUEST_END_DATA {
19506 type Message = MavMessage;
19507 const ID: u32 = 122u32;
19508 const NAME: &'static str = "LOG_REQUEST_END";
19509 const EXTRA_CRC: u8 = 203u8;
19510 const ENCODED_LEN: usize = 2usize;
19511 fn deser(
19512 _version: MavlinkVersion,
19513 __input: &[u8],
19514 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19515 let avail_len = __input.len();
19516 let mut payload_buf = [0; Self::ENCODED_LEN];
19517 let mut buf = if avail_len < Self::ENCODED_LEN {
19518 payload_buf[0..avail_len].copy_from_slice(__input);
19519 Bytes::new(&payload_buf)
19520 } else {
19521 Bytes::new(__input)
19522 };
19523 let mut __struct = Self::default();
19524 __struct.target_system = buf.get_u8();
19525 __struct.target_component = buf.get_u8();
19526 Ok(__struct)
19527 }
19528 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19529 let mut __tmp = BytesMut::new(bytes);
19530 #[allow(clippy::absurd_extreme_comparisons)]
19531 #[allow(unused_comparisons)]
19532 if __tmp.remaining() < Self::ENCODED_LEN {
19533 panic!(
19534 "buffer is too small (need {} bytes, but got {})",
19535 Self::ENCODED_LEN,
19536 __tmp.remaining(),
19537 )
19538 }
19539 __tmp.put_u8(self.target_system);
19540 __tmp.put_u8(self.target_component);
19541 if matches!(version, MavlinkVersion::V2) {
19542 let len = __tmp.len();
19543 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19544 } else {
19545 __tmp.len()
19546 }
19547 }
19548}
19549#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
19550#[doc = ""]
19551#[doc = "ID: 117"]
19552#[derive(Debug, Clone, PartialEq)]
19553#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19554#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19555#[cfg_attr(feature = "ts", derive(TS))]
19556#[cfg_attr(feature = "ts", ts(export))]
19557pub struct LOG_REQUEST_LIST_DATA {
19558 #[doc = "First log id (0 for first available)"]
19559 pub start: u16,
19560 #[doc = "Last log id (0xffff for last available)"]
19561 pub end: u16,
19562 #[doc = "System ID"]
19563 pub target_system: u8,
19564 #[doc = "Component ID"]
19565 pub target_component: u8,
19566}
19567impl LOG_REQUEST_LIST_DATA {
19568 pub const ENCODED_LEN: usize = 6usize;
19569 pub const DEFAULT: Self = Self {
19570 start: 0_u16,
19571 end: 0_u16,
19572 target_system: 0_u8,
19573 target_component: 0_u8,
19574 };
19575 #[cfg(feature = "arbitrary")]
19576 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19577 use arbitrary::{Arbitrary, Unstructured};
19578 let mut buf = [0u8; 1024];
19579 rng.fill_bytes(&mut buf);
19580 let mut unstructured = Unstructured::new(&buf);
19581 Self::arbitrary(&mut unstructured).unwrap_or_default()
19582 }
19583}
19584impl Default for LOG_REQUEST_LIST_DATA {
19585 fn default() -> Self {
19586 Self::DEFAULT.clone()
19587 }
19588}
19589impl MessageData for LOG_REQUEST_LIST_DATA {
19590 type Message = MavMessage;
19591 const ID: u32 = 117u32;
19592 const NAME: &'static str = "LOG_REQUEST_LIST";
19593 const EXTRA_CRC: u8 = 128u8;
19594 const ENCODED_LEN: usize = 6usize;
19595 fn deser(
19596 _version: MavlinkVersion,
19597 __input: &[u8],
19598 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19599 let avail_len = __input.len();
19600 let mut payload_buf = [0; Self::ENCODED_LEN];
19601 let mut buf = if avail_len < Self::ENCODED_LEN {
19602 payload_buf[0..avail_len].copy_from_slice(__input);
19603 Bytes::new(&payload_buf)
19604 } else {
19605 Bytes::new(__input)
19606 };
19607 let mut __struct = Self::default();
19608 __struct.start = buf.get_u16_le();
19609 __struct.end = buf.get_u16_le();
19610 __struct.target_system = buf.get_u8();
19611 __struct.target_component = buf.get_u8();
19612 Ok(__struct)
19613 }
19614 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19615 let mut __tmp = BytesMut::new(bytes);
19616 #[allow(clippy::absurd_extreme_comparisons)]
19617 #[allow(unused_comparisons)]
19618 if __tmp.remaining() < Self::ENCODED_LEN {
19619 panic!(
19620 "buffer is too small (need {} bytes, but got {})",
19621 Self::ENCODED_LEN,
19622 __tmp.remaining(),
19623 )
19624 }
19625 __tmp.put_u16_le(self.start);
19626 __tmp.put_u16_le(self.end);
19627 __tmp.put_u8(self.target_system);
19628 __tmp.put_u8(self.target_component);
19629 if matches!(version, MavlinkVersion::V2) {
19630 let len = __tmp.len();
19631 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19632 } else {
19633 __tmp.len()
19634 }
19635 }
19636}
19637#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
19638#[doc = ""]
19639#[doc = "ID: 192"]
19640#[derive(Debug, Clone, PartialEq)]
19641#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19642#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19643#[cfg_attr(feature = "ts", derive(TS))]
19644#[cfg_attr(feature = "ts", ts(export))]
19645pub struct MAG_CAL_REPORT_DATA {
19646 #[doc = "RMS milligauss residuals."]
19647 pub fitness: f32,
19648 #[doc = "X offset."]
19649 pub ofs_x: f32,
19650 #[doc = "Y offset."]
19651 pub ofs_y: f32,
19652 #[doc = "Z offset."]
19653 pub ofs_z: f32,
19654 #[doc = "X diagonal (matrix 11)."]
19655 pub diag_x: f32,
19656 #[doc = "Y diagonal (matrix 22)."]
19657 pub diag_y: f32,
19658 #[doc = "Z diagonal (matrix 33)."]
19659 pub diag_z: f32,
19660 #[doc = "X off-diagonal (matrix 12 and 21)."]
19661 pub offdiag_x: f32,
19662 #[doc = "Y off-diagonal (matrix 13 and 31)."]
19663 pub offdiag_y: f32,
19664 #[doc = "Z off-diagonal (matrix 32 and 23)."]
19665 pub offdiag_z: f32,
19666 #[doc = "Compass being calibrated."]
19667 pub compass_id: u8,
19668 #[doc = "Bitmask of compasses being calibrated."]
19669 pub cal_mask: u8,
19670 #[doc = "Calibration Status."]
19671 pub cal_status: MagCalStatus,
19672 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
19673 pub autosaved: u8,
19674 #[doc = "Confidence in orientation (higher is better)."]
19675 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19676 pub orientation_confidence: f32,
19677 #[doc = "orientation before calibration."]
19678 #[cfg_attr(feature = "serde", serde(default))]
19679 pub old_orientation: MavSensorOrientation,
19680 #[doc = "orientation after calibration."]
19681 #[cfg_attr(feature = "serde", serde(default))]
19682 pub new_orientation: MavSensorOrientation,
19683 #[doc = "field radius correction factor"]
19684 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19685 pub scale_factor: f32,
19686}
19687impl MAG_CAL_REPORT_DATA {
19688 pub const ENCODED_LEN: usize = 54usize;
19689 pub const DEFAULT: Self = Self {
19690 fitness: 0.0_f32,
19691 ofs_x: 0.0_f32,
19692 ofs_y: 0.0_f32,
19693 ofs_z: 0.0_f32,
19694 diag_x: 0.0_f32,
19695 diag_y: 0.0_f32,
19696 diag_z: 0.0_f32,
19697 offdiag_x: 0.0_f32,
19698 offdiag_y: 0.0_f32,
19699 offdiag_z: 0.0_f32,
19700 compass_id: 0_u8,
19701 cal_mask: 0_u8,
19702 cal_status: MagCalStatus::DEFAULT,
19703 autosaved: 0_u8,
19704 orientation_confidence: 0.0_f32,
19705 old_orientation: MavSensorOrientation::DEFAULT,
19706 new_orientation: MavSensorOrientation::DEFAULT,
19707 scale_factor: 0.0_f32,
19708 };
19709 #[cfg(feature = "arbitrary")]
19710 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19711 use arbitrary::{Arbitrary, Unstructured};
19712 let mut buf = [0u8; 1024];
19713 rng.fill_bytes(&mut buf);
19714 let mut unstructured = Unstructured::new(&buf);
19715 Self::arbitrary(&mut unstructured).unwrap_or_default()
19716 }
19717}
19718impl Default for MAG_CAL_REPORT_DATA {
19719 fn default() -> Self {
19720 Self::DEFAULT.clone()
19721 }
19722}
19723impl MessageData for MAG_CAL_REPORT_DATA {
19724 type Message = MavMessage;
19725 const ID: u32 = 192u32;
19726 const NAME: &'static str = "MAG_CAL_REPORT";
19727 const EXTRA_CRC: u8 = 36u8;
19728 const ENCODED_LEN: usize = 54usize;
19729 fn deser(
19730 _version: MavlinkVersion,
19731 __input: &[u8],
19732 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19733 let avail_len = __input.len();
19734 let mut payload_buf = [0; Self::ENCODED_LEN];
19735 let mut buf = if avail_len < Self::ENCODED_LEN {
19736 payload_buf[0..avail_len].copy_from_slice(__input);
19737 Bytes::new(&payload_buf)
19738 } else {
19739 Bytes::new(__input)
19740 };
19741 let mut __struct = Self::default();
19742 __struct.fitness = buf.get_f32_le();
19743 __struct.ofs_x = buf.get_f32_le();
19744 __struct.ofs_y = buf.get_f32_le();
19745 __struct.ofs_z = buf.get_f32_le();
19746 __struct.diag_x = buf.get_f32_le();
19747 __struct.diag_y = buf.get_f32_le();
19748 __struct.diag_z = buf.get_f32_le();
19749 __struct.offdiag_x = buf.get_f32_le();
19750 __struct.offdiag_y = buf.get_f32_le();
19751 __struct.offdiag_z = buf.get_f32_le();
19752 __struct.compass_id = buf.get_u8();
19753 __struct.cal_mask = buf.get_u8();
19754 let tmp = buf.get_u8();
19755 __struct.cal_status =
19756 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19757 enum_type: "MagCalStatus",
19758 value: tmp as u32,
19759 })?;
19760 __struct.autosaved = buf.get_u8();
19761 __struct.orientation_confidence = buf.get_f32_le();
19762 let tmp = buf.get_u8();
19763 __struct.old_orientation =
19764 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19765 enum_type: "MavSensorOrientation",
19766 value: tmp as u32,
19767 })?;
19768 let tmp = buf.get_u8();
19769 __struct.new_orientation =
19770 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19771 enum_type: "MavSensorOrientation",
19772 value: tmp as u32,
19773 })?;
19774 __struct.scale_factor = buf.get_f32_le();
19775 Ok(__struct)
19776 }
19777 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19778 let mut __tmp = BytesMut::new(bytes);
19779 #[allow(clippy::absurd_extreme_comparisons)]
19780 #[allow(unused_comparisons)]
19781 if __tmp.remaining() < Self::ENCODED_LEN {
19782 panic!(
19783 "buffer is too small (need {} bytes, but got {})",
19784 Self::ENCODED_LEN,
19785 __tmp.remaining(),
19786 )
19787 }
19788 __tmp.put_f32_le(self.fitness);
19789 __tmp.put_f32_le(self.ofs_x);
19790 __tmp.put_f32_le(self.ofs_y);
19791 __tmp.put_f32_le(self.ofs_z);
19792 __tmp.put_f32_le(self.diag_x);
19793 __tmp.put_f32_le(self.diag_y);
19794 __tmp.put_f32_le(self.diag_z);
19795 __tmp.put_f32_le(self.offdiag_x);
19796 __tmp.put_f32_le(self.offdiag_y);
19797 __tmp.put_f32_le(self.offdiag_z);
19798 __tmp.put_u8(self.compass_id);
19799 __tmp.put_u8(self.cal_mask);
19800 __tmp.put_u8(self.cal_status as u8);
19801 __tmp.put_u8(self.autosaved);
19802 if matches!(version, MavlinkVersion::V2) {
19803 __tmp.put_f32_le(self.orientation_confidence);
19804 __tmp.put_u8(self.old_orientation as u8);
19805 __tmp.put_u8(self.new_orientation as u8);
19806 __tmp.put_f32_le(self.scale_factor);
19807 let len = __tmp.len();
19808 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19809 } else {
19810 __tmp.len()
19811 }
19812 }
19813}
19814#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
19815#[doc = ""]
19816#[doc = "ID: 69"]
19817#[derive(Debug, Clone, PartialEq)]
19818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19819#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19820#[cfg_attr(feature = "ts", derive(TS))]
19821#[cfg_attr(feature = "ts", ts(export))]
19822pub struct MANUAL_CONTROL_DATA {
19823 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
19824 pub x: i16,
19825 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
19826 pub y: i16,
19827 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
19828 pub z: i16,
19829 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
19830 pub r: i16,
19831 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
19832 pub buttons: u16,
19833 #[doc = "The system to be controlled."]
19834 pub target: u8,
19835 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
19836 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19837 pub buttons2: u16,
19838 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
19839 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19840 pub enabled_extensions: u8,
19841 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
19842 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19843 pub s: i16,
19844 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
19845 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19846 pub t: i16,
19847 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
19848 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19849 pub aux1: i16,
19850 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
19851 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19852 pub aux2: i16,
19853 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
19854 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19855 pub aux3: i16,
19856 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
19857 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19858 pub aux4: i16,
19859 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
19860 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19861 pub aux5: i16,
19862 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
19863 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19864 pub aux6: i16,
19865}
19866impl MANUAL_CONTROL_DATA {
19867 pub const ENCODED_LEN: usize = 30usize;
19868 pub const DEFAULT: Self = Self {
19869 x: 0_i16,
19870 y: 0_i16,
19871 z: 0_i16,
19872 r: 0_i16,
19873 buttons: 0_u16,
19874 target: 0_u8,
19875 buttons2: 0_u16,
19876 enabled_extensions: 0_u8,
19877 s: 0_i16,
19878 t: 0_i16,
19879 aux1: 0_i16,
19880 aux2: 0_i16,
19881 aux3: 0_i16,
19882 aux4: 0_i16,
19883 aux5: 0_i16,
19884 aux6: 0_i16,
19885 };
19886 #[cfg(feature = "arbitrary")]
19887 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19888 use arbitrary::{Arbitrary, Unstructured};
19889 let mut buf = [0u8; 1024];
19890 rng.fill_bytes(&mut buf);
19891 let mut unstructured = Unstructured::new(&buf);
19892 Self::arbitrary(&mut unstructured).unwrap_or_default()
19893 }
19894}
19895impl Default for MANUAL_CONTROL_DATA {
19896 fn default() -> Self {
19897 Self::DEFAULT.clone()
19898 }
19899}
19900impl MessageData for MANUAL_CONTROL_DATA {
19901 type Message = MavMessage;
19902 const ID: u32 = 69u32;
19903 const NAME: &'static str = "MANUAL_CONTROL";
19904 const EXTRA_CRC: u8 = 243u8;
19905 const ENCODED_LEN: usize = 30usize;
19906 fn deser(
19907 _version: MavlinkVersion,
19908 __input: &[u8],
19909 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19910 let avail_len = __input.len();
19911 let mut payload_buf = [0; Self::ENCODED_LEN];
19912 let mut buf = if avail_len < Self::ENCODED_LEN {
19913 payload_buf[0..avail_len].copy_from_slice(__input);
19914 Bytes::new(&payload_buf)
19915 } else {
19916 Bytes::new(__input)
19917 };
19918 let mut __struct = Self::default();
19919 __struct.x = buf.get_i16_le();
19920 __struct.y = buf.get_i16_le();
19921 __struct.z = buf.get_i16_le();
19922 __struct.r = buf.get_i16_le();
19923 __struct.buttons = buf.get_u16_le();
19924 __struct.target = buf.get_u8();
19925 __struct.buttons2 = buf.get_u16_le();
19926 __struct.enabled_extensions = buf.get_u8();
19927 __struct.s = buf.get_i16_le();
19928 __struct.t = buf.get_i16_le();
19929 __struct.aux1 = buf.get_i16_le();
19930 __struct.aux2 = buf.get_i16_le();
19931 __struct.aux3 = buf.get_i16_le();
19932 __struct.aux4 = buf.get_i16_le();
19933 __struct.aux5 = buf.get_i16_le();
19934 __struct.aux6 = buf.get_i16_le();
19935 Ok(__struct)
19936 }
19937 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19938 let mut __tmp = BytesMut::new(bytes);
19939 #[allow(clippy::absurd_extreme_comparisons)]
19940 #[allow(unused_comparisons)]
19941 if __tmp.remaining() < Self::ENCODED_LEN {
19942 panic!(
19943 "buffer is too small (need {} bytes, but got {})",
19944 Self::ENCODED_LEN,
19945 __tmp.remaining(),
19946 )
19947 }
19948 __tmp.put_i16_le(self.x);
19949 __tmp.put_i16_le(self.y);
19950 __tmp.put_i16_le(self.z);
19951 __tmp.put_i16_le(self.r);
19952 __tmp.put_u16_le(self.buttons);
19953 __tmp.put_u8(self.target);
19954 if matches!(version, MavlinkVersion::V2) {
19955 __tmp.put_u16_le(self.buttons2);
19956 __tmp.put_u8(self.enabled_extensions);
19957 __tmp.put_i16_le(self.s);
19958 __tmp.put_i16_le(self.t);
19959 __tmp.put_i16_le(self.aux1);
19960 __tmp.put_i16_le(self.aux2);
19961 __tmp.put_i16_le(self.aux3);
19962 __tmp.put_i16_le(self.aux4);
19963 __tmp.put_i16_le(self.aux5);
19964 __tmp.put_i16_le(self.aux6);
19965 let len = __tmp.len();
19966 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19967 } else {
19968 __tmp.len()
19969 }
19970 }
19971}
19972#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
19973#[doc = ""]
19974#[doc = "ID: 81"]
19975#[derive(Debug, Clone, PartialEq)]
19976#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19977#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19978#[cfg_attr(feature = "ts", derive(TS))]
19979#[cfg_attr(feature = "ts", ts(export))]
19980pub struct MANUAL_SETPOINT_DATA {
19981 #[doc = "Timestamp (time since system boot)."]
19982 pub time_boot_ms: u32,
19983 #[doc = "Desired roll rate"]
19984 pub roll: f32,
19985 #[doc = "Desired pitch rate"]
19986 pub pitch: f32,
19987 #[doc = "Desired yaw rate"]
19988 pub yaw: f32,
19989 #[doc = "Collective thrust, normalized to 0 .. 1"]
19990 pub thrust: f32,
19991 #[doc = "Flight mode switch position, 0.. 255"]
19992 pub mode_switch: u8,
19993 #[doc = "Override mode switch position, 0.. 255"]
19994 pub manual_override_switch: u8,
19995}
19996impl MANUAL_SETPOINT_DATA {
19997 pub const ENCODED_LEN: usize = 22usize;
19998 pub const DEFAULT: Self = Self {
19999 time_boot_ms: 0_u32,
20000 roll: 0.0_f32,
20001 pitch: 0.0_f32,
20002 yaw: 0.0_f32,
20003 thrust: 0.0_f32,
20004 mode_switch: 0_u8,
20005 manual_override_switch: 0_u8,
20006 };
20007 #[cfg(feature = "arbitrary")]
20008 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20009 use arbitrary::{Arbitrary, Unstructured};
20010 let mut buf = [0u8; 1024];
20011 rng.fill_bytes(&mut buf);
20012 let mut unstructured = Unstructured::new(&buf);
20013 Self::arbitrary(&mut unstructured).unwrap_or_default()
20014 }
20015}
20016impl Default for MANUAL_SETPOINT_DATA {
20017 fn default() -> Self {
20018 Self::DEFAULT.clone()
20019 }
20020}
20021impl MessageData for MANUAL_SETPOINT_DATA {
20022 type Message = MavMessage;
20023 const ID: u32 = 81u32;
20024 const NAME: &'static str = "MANUAL_SETPOINT";
20025 const EXTRA_CRC: u8 = 106u8;
20026 const ENCODED_LEN: usize = 22usize;
20027 fn deser(
20028 _version: MavlinkVersion,
20029 __input: &[u8],
20030 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20031 let avail_len = __input.len();
20032 let mut payload_buf = [0; Self::ENCODED_LEN];
20033 let mut buf = if avail_len < Self::ENCODED_LEN {
20034 payload_buf[0..avail_len].copy_from_slice(__input);
20035 Bytes::new(&payload_buf)
20036 } else {
20037 Bytes::new(__input)
20038 };
20039 let mut __struct = Self::default();
20040 __struct.time_boot_ms = buf.get_u32_le();
20041 __struct.roll = buf.get_f32_le();
20042 __struct.pitch = buf.get_f32_le();
20043 __struct.yaw = buf.get_f32_le();
20044 __struct.thrust = buf.get_f32_le();
20045 __struct.mode_switch = buf.get_u8();
20046 __struct.manual_override_switch = buf.get_u8();
20047 Ok(__struct)
20048 }
20049 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20050 let mut __tmp = BytesMut::new(bytes);
20051 #[allow(clippy::absurd_extreme_comparisons)]
20052 #[allow(unused_comparisons)]
20053 if __tmp.remaining() < Self::ENCODED_LEN {
20054 panic!(
20055 "buffer is too small (need {} bytes, but got {})",
20056 Self::ENCODED_LEN,
20057 __tmp.remaining(),
20058 )
20059 }
20060 __tmp.put_u32_le(self.time_boot_ms);
20061 __tmp.put_f32_le(self.roll);
20062 __tmp.put_f32_le(self.pitch);
20063 __tmp.put_f32_le(self.yaw);
20064 __tmp.put_f32_le(self.thrust);
20065 __tmp.put_u8(self.mode_switch);
20066 __tmp.put_u8(self.manual_override_switch);
20067 if matches!(version, MavlinkVersion::V2) {
20068 let len = __tmp.len();
20069 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20070 } else {
20071 __tmp.len()
20072 }
20073 }
20074}
20075#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20076#[doc = ""]
20077#[doc = "ID: 249"]
20078#[derive(Debug, Clone, PartialEq)]
20079#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20080#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20081#[cfg_attr(feature = "ts", derive(TS))]
20082#[cfg_attr(feature = "ts", ts(export))]
20083pub struct MEMORY_VECT_DATA {
20084 #[doc = "Starting address of the debug variables"]
20085 pub address: u16,
20086 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
20087 pub ver: u8,
20088 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
20089 pub mavtype: u8,
20090 #[doc = "Memory contents at specified address"]
20091 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20092 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
20093 pub value: [i8; 32],
20094}
20095impl MEMORY_VECT_DATA {
20096 pub const ENCODED_LEN: usize = 36usize;
20097 pub const DEFAULT: Self = Self {
20098 address: 0_u16,
20099 ver: 0_u8,
20100 mavtype: 0_u8,
20101 value: [0_i8; 32usize],
20102 };
20103 #[cfg(feature = "arbitrary")]
20104 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20105 use arbitrary::{Arbitrary, Unstructured};
20106 let mut buf = [0u8; 1024];
20107 rng.fill_bytes(&mut buf);
20108 let mut unstructured = Unstructured::new(&buf);
20109 Self::arbitrary(&mut unstructured).unwrap_or_default()
20110 }
20111}
20112impl Default for MEMORY_VECT_DATA {
20113 fn default() -> Self {
20114 Self::DEFAULT.clone()
20115 }
20116}
20117impl MessageData for MEMORY_VECT_DATA {
20118 type Message = MavMessage;
20119 const ID: u32 = 249u32;
20120 const NAME: &'static str = "MEMORY_VECT";
20121 const EXTRA_CRC: u8 = 204u8;
20122 const ENCODED_LEN: usize = 36usize;
20123 fn deser(
20124 _version: MavlinkVersion,
20125 __input: &[u8],
20126 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20127 let avail_len = __input.len();
20128 let mut payload_buf = [0; Self::ENCODED_LEN];
20129 let mut buf = if avail_len < Self::ENCODED_LEN {
20130 payload_buf[0..avail_len].copy_from_slice(__input);
20131 Bytes::new(&payload_buf)
20132 } else {
20133 Bytes::new(__input)
20134 };
20135 let mut __struct = Self::default();
20136 __struct.address = buf.get_u16_le();
20137 __struct.ver = buf.get_u8();
20138 __struct.mavtype = buf.get_u8();
20139 for v in &mut __struct.value {
20140 let val = buf.get_i8();
20141 *v = val;
20142 }
20143 Ok(__struct)
20144 }
20145 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20146 let mut __tmp = BytesMut::new(bytes);
20147 #[allow(clippy::absurd_extreme_comparisons)]
20148 #[allow(unused_comparisons)]
20149 if __tmp.remaining() < Self::ENCODED_LEN {
20150 panic!(
20151 "buffer is too small (need {} bytes, but got {})",
20152 Self::ENCODED_LEN,
20153 __tmp.remaining(),
20154 )
20155 }
20156 __tmp.put_u16_le(self.address);
20157 __tmp.put_u8(self.ver);
20158 __tmp.put_u8(self.mavtype);
20159 for val in &self.value {
20160 __tmp.put_i8(*val);
20161 }
20162 if matches!(version, MavlinkVersion::V2) {
20163 let len = __tmp.len();
20164 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20165 } else {
20166 __tmp.len()
20167 }
20168 }
20169}
20170#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
20171#[doc = ""]
20172#[doc = "ID: 244"]
20173#[derive(Debug, Clone, PartialEq)]
20174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20175#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20176#[cfg_attr(feature = "ts", derive(TS))]
20177#[cfg_attr(feature = "ts", ts(export))]
20178pub struct MESSAGE_INTERVAL_DATA {
20179 #[doc = "0 indicates the interval at which it is sent."]
20180 pub interval_us: i32,
20181 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
20182 pub message_id: u16,
20183}
20184impl MESSAGE_INTERVAL_DATA {
20185 pub const ENCODED_LEN: usize = 6usize;
20186 pub const DEFAULT: Self = Self {
20187 interval_us: 0_i32,
20188 message_id: 0_u16,
20189 };
20190 #[cfg(feature = "arbitrary")]
20191 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20192 use arbitrary::{Arbitrary, Unstructured};
20193 let mut buf = [0u8; 1024];
20194 rng.fill_bytes(&mut buf);
20195 let mut unstructured = Unstructured::new(&buf);
20196 Self::arbitrary(&mut unstructured).unwrap_or_default()
20197 }
20198}
20199impl Default for MESSAGE_INTERVAL_DATA {
20200 fn default() -> Self {
20201 Self::DEFAULT.clone()
20202 }
20203}
20204impl MessageData for MESSAGE_INTERVAL_DATA {
20205 type Message = MavMessage;
20206 const ID: u32 = 244u32;
20207 const NAME: &'static str = "MESSAGE_INTERVAL";
20208 const EXTRA_CRC: u8 = 95u8;
20209 const ENCODED_LEN: usize = 6usize;
20210 fn deser(
20211 _version: MavlinkVersion,
20212 __input: &[u8],
20213 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20214 let avail_len = __input.len();
20215 let mut payload_buf = [0; Self::ENCODED_LEN];
20216 let mut buf = if avail_len < Self::ENCODED_LEN {
20217 payload_buf[0..avail_len].copy_from_slice(__input);
20218 Bytes::new(&payload_buf)
20219 } else {
20220 Bytes::new(__input)
20221 };
20222 let mut __struct = Self::default();
20223 __struct.interval_us = buf.get_i32_le();
20224 __struct.message_id = buf.get_u16_le();
20225 Ok(__struct)
20226 }
20227 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20228 let mut __tmp = BytesMut::new(bytes);
20229 #[allow(clippy::absurd_extreme_comparisons)]
20230 #[allow(unused_comparisons)]
20231 if __tmp.remaining() < Self::ENCODED_LEN {
20232 panic!(
20233 "buffer is too small (need {} bytes, but got {})",
20234 Self::ENCODED_LEN,
20235 __tmp.remaining(),
20236 )
20237 }
20238 __tmp.put_i32_le(self.interval_us);
20239 __tmp.put_u16_le(self.message_id);
20240 if matches!(version, MavlinkVersion::V2) {
20241 let len = __tmp.len();
20242 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20243 } else {
20244 __tmp.len()
20245 }
20246 }
20247}
20248#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
20249#[doc = ""]
20250#[doc = "ID: 47"]
20251#[derive(Debug, Clone, PartialEq)]
20252#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20253#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20254#[cfg_attr(feature = "ts", derive(TS))]
20255#[cfg_attr(feature = "ts", ts(export))]
20256pub struct MISSION_ACK_DATA {
20257 #[doc = "System ID"]
20258 pub target_system: u8,
20259 #[doc = "Component ID"]
20260 pub target_component: u8,
20261 #[doc = "Mission result."]
20262 pub mavtype: MavMissionResult,
20263 #[doc = "Mission type."]
20264 #[cfg_attr(feature = "serde", serde(default))]
20265 pub mission_type: MavMissionType,
20266 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
20267 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20268 pub opaque_id: u32,
20269}
20270impl MISSION_ACK_DATA {
20271 pub const ENCODED_LEN: usize = 8usize;
20272 pub const DEFAULT: Self = Self {
20273 target_system: 0_u8,
20274 target_component: 0_u8,
20275 mavtype: MavMissionResult::DEFAULT,
20276 mission_type: MavMissionType::DEFAULT,
20277 opaque_id: 0_u32,
20278 };
20279 #[cfg(feature = "arbitrary")]
20280 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20281 use arbitrary::{Arbitrary, Unstructured};
20282 let mut buf = [0u8; 1024];
20283 rng.fill_bytes(&mut buf);
20284 let mut unstructured = Unstructured::new(&buf);
20285 Self::arbitrary(&mut unstructured).unwrap_or_default()
20286 }
20287}
20288impl Default for MISSION_ACK_DATA {
20289 fn default() -> Self {
20290 Self::DEFAULT.clone()
20291 }
20292}
20293impl MessageData for MISSION_ACK_DATA {
20294 type Message = MavMessage;
20295 const ID: u32 = 47u32;
20296 const NAME: &'static str = "MISSION_ACK";
20297 const EXTRA_CRC: u8 = 153u8;
20298 const ENCODED_LEN: usize = 8usize;
20299 fn deser(
20300 _version: MavlinkVersion,
20301 __input: &[u8],
20302 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20303 let avail_len = __input.len();
20304 let mut payload_buf = [0; Self::ENCODED_LEN];
20305 let mut buf = if avail_len < Self::ENCODED_LEN {
20306 payload_buf[0..avail_len].copy_from_slice(__input);
20307 Bytes::new(&payload_buf)
20308 } else {
20309 Bytes::new(__input)
20310 };
20311 let mut __struct = Self::default();
20312 __struct.target_system = buf.get_u8();
20313 __struct.target_component = buf.get_u8();
20314 let tmp = buf.get_u8();
20315 __struct.mavtype =
20316 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20317 enum_type: "MavMissionResult",
20318 value: tmp as u32,
20319 })?;
20320 let tmp = buf.get_u8();
20321 __struct.mission_type =
20322 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20323 enum_type: "MavMissionType",
20324 value: tmp as u32,
20325 })?;
20326 __struct.opaque_id = buf.get_u32_le();
20327 Ok(__struct)
20328 }
20329 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20330 let mut __tmp = BytesMut::new(bytes);
20331 #[allow(clippy::absurd_extreme_comparisons)]
20332 #[allow(unused_comparisons)]
20333 if __tmp.remaining() < Self::ENCODED_LEN {
20334 panic!(
20335 "buffer is too small (need {} bytes, but got {})",
20336 Self::ENCODED_LEN,
20337 __tmp.remaining(),
20338 )
20339 }
20340 __tmp.put_u8(self.target_system);
20341 __tmp.put_u8(self.target_component);
20342 __tmp.put_u8(self.mavtype as u8);
20343 if matches!(version, MavlinkVersion::V2) {
20344 __tmp.put_u8(self.mission_type as u8);
20345 __tmp.put_u32_le(self.opaque_id);
20346 let len = __tmp.len();
20347 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20348 } else {
20349 __tmp.len()
20350 }
20351 }
20352}
20353#[doc = "Delete all mission items at once."]
20354#[doc = ""]
20355#[doc = "ID: 45"]
20356#[derive(Debug, Clone, PartialEq)]
20357#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20358#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20359#[cfg_attr(feature = "ts", derive(TS))]
20360#[cfg_attr(feature = "ts", ts(export))]
20361pub struct MISSION_CLEAR_ALL_DATA {
20362 #[doc = "System ID"]
20363 pub target_system: u8,
20364 #[doc = "Component ID"]
20365 pub target_component: u8,
20366 #[doc = "Mission type."]
20367 #[cfg_attr(feature = "serde", serde(default))]
20368 pub mission_type: MavMissionType,
20369}
20370impl MISSION_CLEAR_ALL_DATA {
20371 pub const ENCODED_LEN: usize = 3usize;
20372 pub const DEFAULT: Self = Self {
20373 target_system: 0_u8,
20374 target_component: 0_u8,
20375 mission_type: MavMissionType::DEFAULT,
20376 };
20377 #[cfg(feature = "arbitrary")]
20378 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20379 use arbitrary::{Arbitrary, Unstructured};
20380 let mut buf = [0u8; 1024];
20381 rng.fill_bytes(&mut buf);
20382 let mut unstructured = Unstructured::new(&buf);
20383 Self::arbitrary(&mut unstructured).unwrap_or_default()
20384 }
20385}
20386impl Default for MISSION_CLEAR_ALL_DATA {
20387 fn default() -> Self {
20388 Self::DEFAULT.clone()
20389 }
20390}
20391impl MessageData for MISSION_CLEAR_ALL_DATA {
20392 type Message = MavMessage;
20393 const ID: u32 = 45u32;
20394 const NAME: &'static str = "MISSION_CLEAR_ALL";
20395 const EXTRA_CRC: u8 = 232u8;
20396 const ENCODED_LEN: usize = 3usize;
20397 fn deser(
20398 _version: MavlinkVersion,
20399 __input: &[u8],
20400 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20401 let avail_len = __input.len();
20402 let mut payload_buf = [0; Self::ENCODED_LEN];
20403 let mut buf = if avail_len < Self::ENCODED_LEN {
20404 payload_buf[0..avail_len].copy_from_slice(__input);
20405 Bytes::new(&payload_buf)
20406 } else {
20407 Bytes::new(__input)
20408 };
20409 let mut __struct = Self::default();
20410 __struct.target_system = buf.get_u8();
20411 __struct.target_component = buf.get_u8();
20412 let tmp = buf.get_u8();
20413 __struct.mission_type =
20414 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20415 enum_type: "MavMissionType",
20416 value: tmp as u32,
20417 })?;
20418 Ok(__struct)
20419 }
20420 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20421 let mut __tmp = BytesMut::new(bytes);
20422 #[allow(clippy::absurd_extreme_comparisons)]
20423 #[allow(unused_comparisons)]
20424 if __tmp.remaining() < Self::ENCODED_LEN {
20425 panic!(
20426 "buffer is too small (need {} bytes, but got {})",
20427 Self::ENCODED_LEN,
20428 __tmp.remaining(),
20429 )
20430 }
20431 __tmp.put_u8(self.target_system);
20432 __tmp.put_u8(self.target_component);
20433 if matches!(version, MavlinkVersion::V2) {
20434 __tmp.put_u8(self.mission_type as u8);
20435 let len = __tmp.len();
20436 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20437 } else {
20438 __tmp.len()
20439 }
20440 }
20441}
20442#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
20443#[doc = ""]
20444#[doc = "ID: 44"]
20445#[derive(Debug, Clone, PartialEq)]
20446#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20447#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20448#[cfg_attr(feature = "ts", derive(TS))]
20449#[cfg_attr(feature = "ts", ts(export))]
20450pub struct MISSION_COUNT_DATA {
20451 #[doc = "Number of mission items in the sequence"]
20452 pub count: u16,
20453 #[doc = "System ID"]
20454 pub target_system: u8,
20455 #[doc = "Component ID"]
20456 pub target_component: u8,
20457 #[doc = "Mission type."]
20458 #[cfg_attr(feature = "serde", serde(default))]
20459 pub mission_type: MavMissionType,
20460 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
20461 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20462 pub opaque_id: u32,
20463}
20464impl MISSION_COUNT_DATA {
20465 pub const ENCODED_LEN: usize = 9usize;
20466 pub const DEFAULT: Self = Self {
20467 count: 0_u16,
20468 target_system: 0_u8,
20469 target_component: 0_u8,
20470 mission_type: MavMissionType::DEFAULT,
20471 opaque_id: 0_u32,
20472 };
20473 #[cfg(feature = "arbitrary")]
20474 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20475 use arbitrary::{Arbitrary, Unstructured};
20476 let mut buf = [0u8; 1024];
20477 rng.fill_bytes(&mut buf);
20478 let mut unstructured = Unstructured::new(&buf);
20479 Self::arbitrary(&mut unstructured).unwrap_or_default()
20480 }
20481}
20482impl Default for MISSION_COUNT_DATA {
20483 fn default() -> Self {
20484 Self::DEFAULT.clone()
20485 }
20486}
20487impl MessageData for MISSION_COUNT_DATA {
20488 type Message = MavMessage;
20489 const ID: u32 = 44u32;
20490 const NAME: &'static str = "MISSION_COUNT";
20491 const EXTRA_CRC: u8 = 221u8;
20492 const ENCODED_LEN: usize = 9usize;
20493 fn deser(
20494 _version: MavlinkVersion,
20495 __input: &[u8],
20496 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20497 let avail_len = __input.len();
20498 let mut payload_buf = [0; Self::ENCODED_LEN];
20499 let mut buf = if avail_len < Self::ENCODED_LEN {
20500 payload_buf[0..avail_len].copy_from_slice(__input);
20501 Bytes::new(&payload_buf)
20502 } else {
20503 Bytes::new(__input)
20504 };
20505 let mut __struct = Self::default();
20506 __struct.count = buf.get_u16_le();
20507 __struct.target_system = buf.get_u8();
20508 __struct.target_component = buf.get_u8();
20509 let tmp = buf.get_u8();
20510 __struct.mission_type =
20511 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20512 enum_type: "MavMissionType",
20513 value: tmp as u32,
20514 })?;
20515 __struct.opaque_id = buf.get_u32_le();
20516 Ok(__struct)
20517 }
20518 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20519 let mut __tmp = BytesMut::new(bytes);
20520 #[allow(clippy::absurd_extreme_comparisons)]
20521 #[allow(unused_comparisons)]
20522 if __tmp.remaining() < Self::ENCODED_LEN {
20523 panic!(
20524 "buffer is too small (need {} bytes, but got {})",
20525 Self::ENCODED_LEN,
20526 __tmp.remaining(),
20527 )
20528 }
20529 __tmp.put_u16_le(self.count);
20530 __tmp.put_u8(self.target_system);
20531 __tmp.put_u8(self.target_component);
20532 if matches!(version, MavlinkVersion::V2) {
20533 __tmp.put_u8(self.mission_type as u8);
20534 __tmp.put_u32_le(self.opaque_id);
20535 let len = __tmp.len();
20536 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20537 } else {
20538 __tmp.len()
20539 }
20540 }
20541}
20542#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
20543#[doc = ""]
20544#[doc = "ID: 42"]
20545#[derive(Debug, Clone, PartialEq)]
20546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20547#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20548#[cfg_attr(feature = "ts", derive(TS))]
20549#[cfg_attr(feature = "ts", ts(export))]
20550pub struct MISSION_CURRENT_DATA {
20551 #[doc = "Sequence"]
20552 pub seq: u16,
20553 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
20554 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20555 pub total: u16,
20556 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
20557 #[cfg_attr(feature = "serde", serde(default))]
20558 pub mission_state: MissionState,
20559 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
20560 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20561 pub mission_mode: u8,
20562 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
20563 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20564 pub mission_id: u32,
20565 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
20566 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20567 pub fence_id: u32,
20568 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
20569 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20570 pub rally_points_id: u32,
20571}
20572impl MISSION_CURRENT_DATA {
20573 pub const ENCODED_LEN: usize = 18usize;
20574 pub const DEFAULT: Self = Self {
20575 seq: 0_u16,
20576 total: 0_u16,
20577 mission_state: MissionState::DEFAULT,
20578 mission_mode: 0_u8,
20579 mission_id: 0_u32,
20580 fence_id: 0_u32,
20581 rally_points_id: 0_u32,
20582 };
20583 #[cfg(feature = "arbitrary")]
20584 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20585 use arbitrary::{Arbitrary, Unstructured};
20586 let mut buf = [0u8; 1024];
20587 rng.fill_bytes(&mut buf);
20588 let mut unstructured = Unstructured::new(&buf);
20589 Self::arbitrary(&mut unstructured).unwrap_or_default()
20590 }
20591}
20592impl Default for MISSION_CURRENT_DATA {
20593 fn default() -> Self {
20594 Self::DEFAULT.clone()
20595 }
20596}
20597impl MessageData for MISSION_CURRENT_DATA {
20598 type Message = MavMessage;
20599 const ID: u32 = 42u32;
20600 const NAME: &'static str = "MISSION_CURRENT";
20601 const EXTRA_CRC: u8 = 28u8;
20602 const ENCODED_LEN: usize = 18usize;
20603 fn deser(
20604 _version: MavlinkVersion,
20605 __input: &[u8],
20606 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20607 let avail_len = __input.len();
20608 let mut payload_buf = [0; Self::ENCODED_LEN];
20609 let mut buf = if avail_len < Self::ENCODED_LEN {
20610 payload_buf[0..avail_len].copy_from_slice(__input);
20611 Bytes::new(&payload_buf)
20612 } else {
20613 Bytes::new(__input)
20614 };
20615 let mut __struct = Self::default();
20616 __struct.seq = buf.get_u16_le();
20617 __struct.total = buf.get_u16_le();
20618 let tmp = buf.get_u8();
20619 __struct.mission_state =
20620 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20621 enum_type: "MissionState",
20622 value: tmp as u32,
20623 })?;
20624 __struct.mission_mode = buf.get_u8();
20625 __struct.mission_id = buf.get_u32_le();
20626 __struct.fence_id = buf.get_u32_le();
20627 __struct.rally_points_id = buf.get_u32_le();
20628 Ok(__struct)
20629 }
20630 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20631 let mut __tmp = BytesMut::new(bytes);
20632 #[allow(clippy::absurd_extreme_comparisons)]
20633 #[allow(unused_comparisons)]
20634 if __tmp.remaining() < Self::ENCODED_LEN {
20635 panic!(
20636 "buffer is too small (need {} bytes, but got {})",
20637 Self::ENCODED_LEN,
20638 __tmp.remaining(),
20639 )
20640 }
20641 __tmp.put_u16_le(self.seq);
20642 if matches!(version, MavlinkVersion::V2) {
20643 __tmp.put_u16_le(self.total);
20644 __tmp.put_u8(self.mission_state as u8);
20645 __tmp.put_u8(self.mission_mode);
20646 __tmp.put_u32_le(self.mission_id);
20647 __tmp.put_u32_le(self.fence_id);
20648 __tmp.put_u32_le(self.rally_points_id);
20649 let len = __tmp.len();
20650 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20651 } else {
20652 __tmp.len()
20653 }
20654 }
20655}
20656#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
20657#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20658#[doc = ""]
20659#[doc = "ID: 39"]
20660#[derive(Debug, Clone, PartialEq)]
20661#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20662#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20663#[cfg_attr(feature = "ts", derive(TS))]
20664#[cfg_attr(feature = "ts", ts(export))]
20665pub struct MISSION_ITEM_DATA {
20666 #[doc = "PARAM1, see MAV_CMD enum"]
20667 pub param1: f32,
20668 #[doc = "PARAM2, see MAV_CMD enum"]
20669 pub param2: f32,
20670 #[doc = "PARAM3, see MAV_CMD enum"]
20671 pub param3: f32,
20672 #[doc = "PARAM4, see MAV_CMD enum"]
20673 pub param4: f32,
20674 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
20675 pub x: f32,
20676 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
20677 pub y: f32,
20678 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
20679 pub z: f32,
20680 #[doc = "Sequence"]
20681 pub seq: u16,
20682 #[doc = "The scheduled action for the waypoint."]
20683 pub command: MavCmd,
20684 #[doc = "System ID"]
20685 pub target_system: u8,
20686 #[doc = "Component ID"]
20687 pub target_component: u8,
20688 #[doc = "The coordinate system of the waypoint."]
20689 pub frame: MavFrame,
20690 #[doc = "false:0, true:1"]
20691 pub current: u8,
20692 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20693 pub autocontinue: u8,
20694 #[doc = "Mission type."]
20695 #[cfg_attr(feature = "serde", serde(default))]
20696 pub mission_type: MavMissionType,
20697}
20698impl MISSION_ITEM_DATA {
20699 pub const ENCODED_LEN: usize = 38usize;
20700 pub const DEFAULT: Self = Self {
20701 param1: 0.0_f32,
20702 param2: 0.0_f32,
20703 param3: 0.0_f32,
20704 param4: 0.0_f32,
20705 x: 0.0_f32,
20706 y: 0.0_f32,
20707 z: 0.0_f32,
20708 seq: 0_u16,
20709 command: MavCmd::DEFAULT,
20710 target_system: 0_u8,
20711 target_component: 0_u8,
20712 frame: MavFrame::DEFAULT,
20713 current: 0_u8,
20714 autocontinue: 0_u8,
20715 mission_type: MavMissionType::DEFAULT,
20716 };
20717 #[cfg(feature = "arbitrary")]
20718 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20719 use arbitrary::{Arbitrary, Unstructured};
20720 let mut buf = [0u8; 1024];
20721 rng.fill_bytes(&mut buf);
20722 let mut unstructured = Unstructured::new(&buf);
20723 Self::arbitrary(&mut unstructured).unwrap_or_default()
20724 }
20725}
20726impl Default for MISSION_ITEM_DATA {
20727 fn default() -> Self {
20728 Self::DEFAULT.clone()
20729 }
20730}
20731impl MessageData for MISSION_ITEM_DATA {
20732 type Message = MavMessage;
20733 const ID: u32 = 39u32;
20734 const NAME: &'static str = "MISSION_ITEM";
20735 const EXTRA_CRC: u8 = 254u8;
20736 const ENCODED_LEN: usize = 38usize;
20737 fn deser(
20738 _version: MavlinkVersion,
20739 __input: &[u8],
20740 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20741 let avail_len = __input.len();
20742 let mut payload_buf = [0; Self::ENCODED_LEN];
20743 let mut buf = if avail_len < Self::ENCODED_LEN {
20744 payload_buf[0..avail_len].copy_from_slice(__input);
20745 Bytes::new(&payload_buf)
20746 } else {
20747 Bytes::new(__input)
20748 };
20749 let mut __struct = Self::default();
20750 __struct.param1 = buf.get_f32_le();
20751 __struct.param2 = buf.get_f32_le();
20752 __struct.param3 = buf.get_f32_le();
20753 __struct.param4 = buf.get_f32_le();
20754 __struct.x = buf.get_f32_le();
20755 __struct.y = buf.get_f32_le();
20756 __struct.z = buf.get_f32_le();
20757 __struct.seq = buf.get_u16_le();
20758 let tmp = buf.get_u16_le();
20759 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20760 ::mavlink_core::error::ParserError::InvalidEnum {
20761 enum_type: "MavCmd",
20762 value: tmp as u32,
20763 },
20764 )?;
20765 __struct.target_system = buf.get_u8();
20766 __struct.target_component = buf.get_u8();
20767 let tmp = buf.get_u8();
20768 __struct.frame =
20769 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20770 enum_type: "MavFrame",
20771 value: tmp as u32,
20772 })?;
20773 __struct.current = buf.get_u8();
20774 __struct.autocontinue = buf.get_u8();
20775 let tmp = buf.get_u8();
20776 __struct.mission_type =
20777 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20778 enum_type: "MavMissionType",
20779 value: tmp as u32,
20780 })?;
20781 Ok(__struct)
20782 }
20783 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20784 let mut __tmp = BytesMut::new(bytes);
20785 #[allow(clippy::absurd_extreme_comparisons)]
20786 #[allow(unused_comparisons)]
20787 if __tmp.remaining() < Self::ENCODED_LEN {
20788 panic!(
20789 "buffer is too small (need {} bytes, but got {})",
20790 Self::ENCODED_LEN,
20791 __tmp.remaining(),
20792 )
20793 }
20794 __tmp.put_f32_le(self.param1);
20795 __tmp.put_f32_le(self.param2);
20796 __tmp.put_f32_le(self.param3);
20797 __tmp.put_f32_le(self.param4);
20798 __tmp.put_f32_le(self.x);
20799 __tmp.put_f32_le(self.y);
20800 __tmp.put_f32_le(self.z);
20801 __tmp.put_u16_le(self.seq);
20802 __tmp.put_u16_le(self.command as u16);
20803 __tmp.put_u8(self.target_system);
20804 __tmp.put_u8(self.target_component);
20805 __tmp.put_u8(self.frame as u8);
20806 __tmp.put_u8(self.current);
20807 __tmp.put_u8(self.autocontinue);
20808 if matches!(version, MavlinkVersion::V2) {
20809 __tmp.put_u8(self.mission_type as u8);
20810 let len = __tmp.len();
20811 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20812 } else {
20813 __tmp.len()
20814 }
20815 }
20816}
20817#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20818#[doc = ""]
20819#[doc = "ID: 73"]
20820#[derive(Debug, Clone, PartialEq)]
20821#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20822#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20823#[cfg_attr(feature = "ts", derive(TS))]
20824#[cfg_attr(feature = "ts", ts(export))]
20825pub struct MISSION_ITEM_INT_DATA {
20826 #[doc = "PARAM1, see MAV_CMD enum"]
20827 pub param1: f32,
20828 #[doc = "PARAM2, see MAV_CMD enum"]
20829 pub param2: f32,
20830 #[doc = "PARAM3, see MAV_CMD enum"]
20831 pub param3: f32,
20832 #[doc = "PARAM4, see MAV_CMD enum"]
20833 pub param4: f32,
20834 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
20835 pub x: i32,
20836 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
20837 pub y: i32,
20838 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
20839 pub z: f32,
20840 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
20841 pub seq: u16,
20842 #[doc = "The scheduled action for the waypoint."]
20843 pub command: MavCmd,
20844 #[doc = "System ID"]
20845 pub target_system: u8,
20846 #[doc = "Component ID"]
20847 pub target_component: u8,
20848 #[doc = "The coordinate system of the waypoint."]
20849 pub frame: MavFrame,
20850 #[doc = "false:0, true:1"]
20851 pub current: u8,
20852 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20853 pub autocontinue: u8,
20854 #[doc = "Mission type."]
20855 #[cfg_attr(feature = "serde", serde(default))]
20856 pub mission_type: MavMissionType,
20857}
20858impl MISSION_ITEM_INT_DATA {
20859 pub const ENCODED_LEN: usize = 38usize;
20860 pub const DEFAULT: Self = Self {
20861 param1: 0.0_f32,
20862 param2: 0.0_f32,
20863 param3: 0.0_f32,
20864 param4: 0.0_f32,
20865 x: 0_i32,
20866 y: 0_i32,
20867 z: 0.0_f32,
20868 seq: 0_u16,
20869 command: MavCmd::DEFAULT,
20870 target_system: 0_u8,
20871 target_component: 0_u8,
20872 frame: MavFrame::DEFAULT,
20873 current: 0_u8,
20874 autocontinue: 0_u8,
20875 mission_type: MavMissionType::DEFAULT,
20876 };
20877 #[cfg(feature = "arbitrary")]
20878 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20879 use arbitrary::{Arbitrary, Unstructured};
20880 let mut buf = [0u8; 1024];
20881 rng.fill_bytes(&mut buf);
20882 let mut unstructured = Unstructured::new(&buf);
20883 Self::arbitrary(&mut unstructured).unwrap_or_default()
20884 }
20885}
20886impl Default for MISSION_ITEM_INT_DATA {
20887 fn default() -> Self {
20888 Self::DEFAULT.clone()
20889 }
20890}
20891impl MessageData for MISSION_ITEM_INT_DATA {
20892 type Message = MavMessage;
20893 const ID: u32 = 73u32;
20894 const NAME: &'static str = "MISSION_ITEM_INT";
20895 const EXTRA_CRC: u8 = 38u8;
20896 const ENCODED_LEN: usize = 38usize;
20897 fn deser(
20898 _version: MavlinkVersion,
20899 __input: &[u8],
20900 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20901 let avail_len = __input.len();
20902 let mut payload_buf = [0; Self::ENCODED_LEN];
20903 let mut buf = if avail_len < Self::ENCODED_LEN {
20904 payload_buf[0..avail_len].copy_from_slice(__input);
20905 Bytes::new(&payload_buf)
20906 } else {
20907 Bytes::new(__input)
20908 };
20909 let mut __struct = Self::default();
20910 __struct.param1 = buf.get_f32_le();
20911 __struct.param2 = buf.get_f32_le();
20912 __struct.param3 = buf.get_f32_le();
20913 __struct.param4 = buf.get_f32_le();
20914 __struct.x = buf.get_i32_le();
20915 __struct.y = buf.get_i32_le();
20916 __struct.z = buf.get_f32_le();
20917 __struct.seq = buf.get_u16_le();
20918 let tmp = buf.get_u16_le();
20919 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20920 ::mavlink_core::error::ParserError::InvalidEnum {
20921 enum_type: "MavCmd",
20922 value: tmp as u32,
20923 },
20924 )?;
20925 __struct.target_system = buf.get_u8();
20926 __struct.target_component = buf.get_u8();
20927 let tmp = buf.get_u8();
20928 __struct.frame =
20929 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20930 enum_type: "MavFrame",
20931 value: tmp as u32,
20932 })?;
20933 __struct.current = buf.get_u8();
20934 __struct.autocontinue = buf.get_u8();
20935 let tmp = buf.get_u8();
20936 __struct.mission_type =
20937 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20938 enum_type: "MavMissionType",
20939 value: tmp as u32,
20940 })?;
20941 Ok(__struct)
20942 }
20943 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20944 let mut __tmp = BytesMut::new(bytes);
20945 #[allow(clippy::absurd_extreme_comparisons)]
20946 #[allow(unused_comparisons)]
20947 if __tmp.remaining() < Self::ENCODED_LEN {
20948 panic!(
20949 "buffer is too small (need {} bytes, but got {})",
20950 Self::ENCODED_LEN,
20951 __tmp.remaining(),
20952 )
20953 }
20954 __tmp.put_f32_le(self.param1);
20955 __tmp.put_f32_le(self.param2);
20956 __tmp.put_f32_le(self.param3);
20957 __tmp.put_f32_le(self.param4);
20958 __tmp.put_i32_le(self.x);
20959 __tmp.put_i32_le(self.y);
20960 __tmp.put_f32_le(self.z);
20961 __tmp.put_u16_le(self.seq);
20962 __tmp.put_u16_le(self.command as u16);
20963 __tmp.put_u8(self.target_system);
20964 __tmp.put_u8(self.target_component);
20965 __tmp.put_u8(self.frame as u8);
20966 __tmp.put_u8(self.current);
20967 __tmp.put_u8(self.autocontinue);
20968 if matches!(version, MavlinkVersion::V2) {
20969 __tmp.put_u8(self.mission_type as u8);
20970 let len = __tmp.len();
20971 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20972 } else {
20973 __tmp.len()
20974 }
20975 }
20976}
20977#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
20978#[doc = ""]
20979#[doc = "ID: 46"]
20980#[derive(Debug, Clone, PartialEq)]
20981#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20982#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20983#[cfg_attr(feature = "ts", derive(TS))]
20984#[cfg_attr(feature = "ts", ts(export))]
20985pub struct MISSION_ITEM_REACHED_DATA {
20986 #[doc = "Sequence"]
20987 pub seq: u16,
20988}
20989impl MISSION_ITEM_REACHED_DATA {
20990 pub const ENCODED_LEN: usize = 2usize;
20991 pub const DEFAULT: Self = Self { seq: 0_u16 };
20992 #[cfg(feature = "arbitrary")]
20993 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20994 use arbitrary::{Arbitrary, Unstructured};
20995 let mut buf = [0u8; 1024];
20996 rng.fill_bytes(&mut buf);
20997 let mut unstructured = Unstructured::new(&buf);
20998 Self::arbitrary(&mut unstructured).unwrap_or_default()
20999 }
21000}
21001impl Default for MISSION_ITEM_REACHED_DATA {
21002 fn default() -> Self {
21003 Self::DEFAULT.clone()
21004 }
21005}
21006impl MessageData for MISSION_ITEM_REACHED_DATA {
21007 type Message = MavMessage;
21008 const ID: u32 = 46u32;
21009 const NAME: &'static str = "MISSION_ITEM_REACHED";
21010 const EXTRA_CRC: u8 = 11u8;
21011 const ENCODED_LEN: usize = 2usize;
21012 fn deser(
21013 _version: MavlinkVersion,
21014 __input: &[u8],
21015 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21016 let avail_len = __input.len();
21017 let mut payload_buf = [0; Self::ENCODED_LEN];
21018 let mut buf = if avail_len < Self::ENCODED_LEN {
21019 payload_buf[0..avail_len].copy_from_slice(__input);
21020 Bytes::new(&payload_buf)
21021 } else {
21022 Bytes::new(__input)
21023 };
21024 let mut __struct = Self::default();
21025 __struct.seq = buf.get_u16_le();
21026 Ok(__struct)
21027 }
21028 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21029 let mut __tmp = BytesMut::new(bytes);
21030 #[allow(clippy::absurd_extreme_comparisons)]
21031 #[allow(unused_comparisons)]
21032 if __tmp.remaining() < Self::ENCODED_LEN {
21033 panic!(
21034 "buffer is too small (need {} bytes, but got {})",
21035 Self::ENCODED_LEN,
21036 __tmp.remaining(),
21037 )
21038 }
21039 __tmp.put_u16_le(self.seq);
21040 if matches!(version, MavlinkVersion::V2) {
21041 let len = __tmp.len();
21042 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21043 } else {
21044 __tmp.len()
21045 }
21046 }
21047}
21048#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
21049#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
21050#[doc = ""]
21051#[doc = "ID: 40"]
21052#[derive(Debug, Clone, PartialEq)]
21053#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21054#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21055#[cfg_attr(feature = "ts", derive(TS))]
21056#[cfg_attr(feature = "ts", ts(export))]
21057pub struct MISSION_REQUEST_DATA {
21058 #[doc = "Sequence"]
21059 pub seq: u16,
21060 #[doc = "System ID"]
21061 pub target_system: u8,
21062 #[doc = "Component ID"]
21063 pub target_component: u8,
21064 #[doc = "Mission type."]
21065 #[cfg_attr(feature = "serde", serde(default))]
21066 pub mission_type: MavMissionType,
21067}
21068impl MISSION_REQUEST_DATA {
21069 pub const ENCODED_LEN: usize = 5usize;
21070 pub const DEFAULT: Self = Self {
21071 seq: 0_u16,
21072 target_system: 0_u8,
21073 target_component: 0_u8,
21074 mission_type: MavMissionType::DEFAULT,
21075 };
21076 #[cfg(feature = "arbitrary")]
21077 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21078 use arbitrary::{Arbitrary, Unstructured};
21079 let mut buf = [0u8; 1024];
21080 rng.fill_bytes(&mut buf);
21081 let mut unstructured = Unstructured::new(&buf);
21082 Self::arbitrary(&mut unstructured).unwrap_or_default()
21083 }
21084}
21085impl Default for MISSION_REQUEST_DATA {
21086 fn default() -> Self {
21087 Self::DEFAULT.clone()
21088 }
21089}
21090impl MessageData for MISSION_REQUEST_DATA {
21091 type Message = MavMessage;
21092 const ID: u32 = 40u32;
21093 const NAME: &'static str = "MISSION_REQUEST";
21094 const EXTRA_CRC: u8 = 230u8;
21095 const ENCODED_LEN: usize = 5usize;
21096 fn deser(
21097 _version: MavlinkVersion,
21098 __input: &[u8],
21099 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21100 let avail_len = __input.len();
21101 let mut payload_buf = [0; Self::ENCODED_LEN];
21102 let mut buf = if avail_len < Self::ENCODED_LEN {
21103 payload_buf[0..avail_len].copy_from_slice(__input);
21104 Bytes::new(&payload_buf)
21105 } else {
21106 Bytes::new(__input)
21107 };
21108 let mut __struct = Self::default();
21109 __struct.seq = buf.get_u16_le();
21110 __struct.target_system = buf.get_u8();
21111 __struct.target_component = buf.get_u8();
21112 let tmp = buf.get_u8();
21113 __struct.mission_type =
21114 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21115 enum_type: "MavMissionType",
21116 value: tmp as u32,
21117 })?;
21118 Ok(__struct)
21119 }
21120 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21121 let mut __tmp = BytesMut::new(bytes);
21122 #[allow(clippy::absurd_extreme_comparisons)]
21123 #[allow(unused_comparisons)]
21124 if __tmp.remaining() < Self::ENCODED_LEN {
21125 panic!(
21126 "buffer is too small (need {} bytes, but got {})",
21127 Self::ENCODED_LEN,
21128 __tmp.remaining(),
21129 )
21130 }
21131 __tmp.put_u16_le(self.seq);
21132 __tmp.put_u8(self.target_system);
21133 __tmp.put_u8(self.target_component);
21134 if matches!(version, MavlinkVersion::V2) {
21135 __tmp.put_u8(self.mission_type as u8);
21136 let len = __tmp.len();
21137 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21138 } else {
21139 __tmp.len()
21140 }
21141 }
21142}
21143#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
21144#[doc = ""]
21145#[doc = "ID: 51"]
21146#[derive(Debug, Clone, PartialEq)]
21147#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21148#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21149#[cfg_attr(feature = "ts", derive(TS))]
21150#[cfg_attr(feature = "ts", ts(export))]
21151pub struct MISSION_REQUEST_INT_DATA {
21152 #[doc = "Sequence"]
21153 pub seq: u16,
21154 #[doc = "System ID"]
21155 pub target_system: u8,
21156 #[doc = "Component ID"]
21157 pub target_component: u8,
21158 #[doc = "Mission type."]
21159 #[cfg_attr(feature = "serde", serde(default))]
21160 pub mission_type: MavMissionType,
21161}
21162impl MISSION_REQUEST_INT_DATA {
21163 pub const ENCODED_LEN: usize = 5usize;
21164 pub const DEFAULT: Self = Self {
21165 seq: 0_u16,
21166 target_system: 0_u8,
21167 target_component: 0_u8,
21168 mission_type: MavMissionType::DEFAULT,
21169 };
21170 #[cfg(feature = "arbitrary")]
21171 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21172 use arbitrary::{Arbitrary, Unstructured};
21173 let mut buf = [0u8; 1024];
21174 rng.fill_bytes(&mut buf);
21175 let mut unstructured = Unstructured::new(&buf);
21176 Self::arbitrary(&mut unstructured).unwrap_or_default()
21177 }
21178}
21179impl Default for MISSION_REQUEST_INT_DATA {
21180 fn default() -> Self {
21181 Self::DEFAULT.clone()
21182 }
21183}
21184impl MessageData for MISSION_REQUEST_INT_DATA {
21185 type Message = MavMessage;
21186 const ID: u32 = 51u32;
21187 const NAME: &'static str = "MISSION_REQUEST_INT";
21188 const EXTRA_CRC: u8 = 196u8;
21189 const ENCODED_LEN: usize = 5usize;
21190 fn deser(
21191 _version: MavlinkVersion,
21192 __input: &[u8],
21193 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21194 let avail_len = __input.len();
21195 let mut payload_buf = [0; Self::ENCODED_LEN];
21196 let mut buf = if avail_len < Self::ENCODED_LEN {
21197 payload_buf[0..avail_len].copy_from_slice(__input);
21198 Bytes::new(&payload_buf)
21199 } else {
21200 Bytes::new(__input)
21201 };
21202 let mut __struct = Self::default();
21203 __struct.seq = buf.get_u16_le();
21204 __struct.target_system = buf.get_u8();
21205 __struct.target_component = buf.get_u8();
21206 let tmp = buf.get_u8();
21207 __struct.mission_type =
21208 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21209 enum_type: "MavMissionType",
21210 value: tmp as u32,
21211 })?;
21212 Ok(__struct)
21213 }
21214 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21215 let mut __tmp = BytesMut::new(bytes);
21216 #[allow(clippy::absurd_extreme_comparisons)]
21217 #[allow(unused_comparisons)]
21218 if __tmp.remaining() < Self::ENCODED_LEN {
21219 panic!(
21220 "buffer is too small (need {} bytes, but got {})",
21221 Self::ENCODED_LEN,
21222 __tmp.remaining(),
21223 )
21224 }
21225 __tmp.put_u16_le(self.seq);
21226 __tmp.put_u8(self.target_system);
21227 __tmp.put_u8(self.target_component);
21228 if matches!(version, MavlinkVersion::V2) {
21229 __tmp.put_u8(self.mission_type as u8);
21230 let len = __tmp.len();
21231 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21232 } else {
21233 __tmp.len()
21234 }
21235 }
21236}
21237#[doc = "Request the overall list of mission items from the system/component."]
21238#[doc = ""]
21239#[doc = "ID: 43"]
21240#[derive(Debug, Clone, PartialEq)]
21241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21242#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21243#[cfg_attr(feature = "ts", derive(TS))]
21244#[cfg_attr(feature = "ts", ts(export))]
21245pub struct MISSION_REQUEST_LIST_DATA {
21246 #[doc = "System ID"]
21247 pub target_system: u8,
21248 #[doc = "Component ID"]
21249 pub target_component: u8,
21250 #[doc = "Mission type."]
21251 #[cfg_attr(feature = "serde", serde(default))]
21252 pub mission_type: MavMissionType,
21253}
21254impl MISSION_REQUEST_LIST_DATA {
21255 pub const ENCODED_LEN: usize = 3usize;
21256 pub const DEFAULT: Self = Self {
21257 target_system: 0_u8,
21258 target_component: 0_u8,
21259 mission_type: MavMissionType::DEFAULT,
21260 };
21261 #[cfg(feature = "arbitrary")]
21262 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21263 use arbitrary::{Arbitrary, Unstructured};
21264 let mut buf = [0u8; 1024];
21265 rng.fill_bytes(&mut buf);
21266 let mut unstructured = Unstructured::new(&buf);
21267 Self::arbitrary(&mut unstructured).unwrap_or_default()
21268 }
21269}
21270impl Default for MISSION_REQUEST_LIST_DATA {
21271 fn default() -> Self {
21272 Self::DEFAULT.clone()
21273 }
21274}
21275impl MessageData for MISSION_REQUEST_LIST_DATA {
21276 type Message = MavMessage;
21277 const ID: u32 = 43u32;
21278 const NAME: &'static str = "MISSION_REQUEST_LIST";
21279 const EXTRA_CRC: u8 = 132u8;
21280 const ENCODED_LEN: usize = 3usize;
21281 fn deser(
21282 _version: MavlinkVersion,
21283 __input: &[u8],
21284 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21285 let avail_len = __input.len();
21286 let mut payload_buf = [0; Self::ENCODED_LEN];
21287 let mut buf = if avail_len < Self::ENCODED_LEN {
21288 payload_buf[0..avail_len].copy_from_slice(__input);
21289 Bytes::new(&payload_buf)
21290 } else {
21291 Bytes::new(__input)
21292 };
21293 let mut __struct = Self::default();
21294 __struct.target_system = buf.get_u8();
21295 __struct.target_component = buf.get_u8();
21296 let tmp = buf.get_u8();
21297 __struct.mission_type =
21298 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21299 enum_type: "MavMissionType",
21300 value: tmp as u32,
21301 })?;
21302 Ok(__struct)
21303 }
21304 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21305 let mut __tmp = BytesMut::new(bytes);
21306 #[allow(clippy::absurd_extreme_comparisons)]
21307 #[allow(unused_comparisons)]
21308 if __tmp.remaining() < Self::ENCODED_LEN {
21309 panic!(
21310 "buffer is too small (need {} bytes, but got {})",
21311 Self::ENCODED_LEN,
21312 __tmp.remaining(),
21313 )
21314 }
21315 __tmp.put_u8(self.target_system);
21316 __tmp.put_u8(self.target_component);
21317 if matches!(version, MavlinkVersion::V2) {
21318 __tmp.put_u8(self.mission_type as u8);
21319 let len = __tmp.len();
21320 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21321 } else {
21322 __tmp.len()
21323 }
21324 }
21325}
21326#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
21327#[doc = ""]
21328#[doc = "ID: 37"]
21329#[derive(Debug, Clone, PartialEq)]
21330#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21331#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21332#[cfg_attr(feature = "ts", derive(TS))]
21333#[cfg_attr(feature = "ts", ts(export))]
21334pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
21335 #[doc = "Start index"]
21336 pub start_index: i16,
21337 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
21338 pub end_index: i16,
21339 #[doc = "System ID"]
21340 pub target_system: u8,
21341 #[doc = "Component ID"]
21342 pub target_component: u8,
21343 #[doc = "Mission type."]
21344 #[cfg_attr(feature = "serde", serde(default))]
21345 pub mission_type: MavMissionType,
21346}
21347impl MISSION_REQUEST_PARTIAL_LIST_DATA {
21348 pub const ENCODED_LEN: usize = 7usize;
21349 pub const DEFAULT: Self = Self {
21350 start_index: 0_i16,
21351 end_index: 0_i16,
21352 target_system: 0_u8,
21353 target_component: 0_u8,
21354 mission_type: MavMissionType::DEFAULT,
21355 };
21356 #[cfg(feature = "arbitrary")]
21357 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21358 use arbitrary::{Arbitrary, Unstructured};
21359 let mut buf = [0u8; 1024];
21360 rng.fill_bytes(&mut buf);
21361 let mut unstructured = Unstructured::new(&buf);
21362 Self::arbitrary(&mut unstructured).unwrap_or_default()
21363 }
21364}
21365impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
21366 fn default() -> Self {
21367 Self::DEFAULT.clone()
21368 }
21369}
21370impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
21371 type Message = MavMessage;
21372 const ID: u32 = 37u32;
21373 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
21374 const EXTRA_CRC: u8 = 212u8;
21375 const ENCODED_LEN: usize = 7usize;
21376 fn deser(
21377 _version: MavlinkVersion,
21378 __input: &[u8],
21379 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21380 let avail_len = __input.len();
21381 let mut payload_buf = [0; Self::ENCODED_LEN];
21382 let mut buf = if avail_len < Self::ENCODED_LEN {
21383 payload_buf[0..avail_len].copy_from_slice(__input);
21384 Bytes::new(&payload_buf)
21385 } else {
21386 Bytes::new(__input)
21387 };
21388 let mut __struct = Self::default();
21389 __struct.start_index = buf.get_i16_le();
21390 __struct.end_index = buf.get_i16_le();
21391 __struct.target_system = buf.get_u8();
21392 __struct.target_component = buf.get_u8();
21393 let tmp = buf.get_u8();
21394 __struct.mission_type =
21395 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21396 enum_type: "MavMissionType",
21397 value: tmp as u32,
21398 })?;
21399 Ok(__struct)
21400 }
21401 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21402 let mut __tmp = BytesMut::new(bytes);
21403 #[allow(clippy::absurd_extreme_comparisons)]
21404 #[allow(unused_comparisons)]
21405 if __tmp.remaining() < Self::ENCODED_LEN {
21406 panic!(
21407 "buffer is too small (need {} bytes, but got {})",
21408 Self::ENCODED_LEN,
21409 __tmp.remaining(),
21410 )
21411 }
21412 __tmp.put_i16_le(self.start_index);
21413 __tmp.put_i16_le(self.end_index);
21414 __tmp.put_u8(self.target_system);
21415 __tmp.put_u8(self.target_component);
21416 if matches!(version, MavlinkVersion::V2) {
21417 __tmp.put_u8(self.mission_type as u8);
21418 let len = __tmp.len();
21419 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21420 } else {
21421 __tmp.len()
21422 }
21423 }
21424}
21425#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
21426#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
21427#[doc = ""]
21428#[doc = "ID: 41"]
21429#[derive(Debug, Clone, PartialEq)]
21430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21431#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21432#[cfg_attr(feature = "ts", derive(TS))]
21433#[cfg_attr(feature = "ts", ts(export))]
21434pub struct MISSION_SET_CURRENT_DATA {
21435 #[doc = "Sequence"]
21436 pub seq: u16,
21437 #[doc = "System ID"]
21438 pub target_system: u8,
21439 #[doc = "Component ID"]
21440 pub target_component: u8,
21441}
21442impl MISSION_SET_CURRENT_DATA {
21443 pub const ENCODED_LEN: usize = 4usize;
21444 pub const DEFAULT: Self = Self {
21445 seq: 0_u16,
21446 target_system: 0_u8,
21447 target_component: 0_u8,
21448 };
21449 #[cfg(feature = "arbitrary")]
21450 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21451 use arbitrary::{Arbitrary, Unstructured};
21452 let mut buf = [0u8; 1024];
21453 rng.fill_bytes(&mut buf);
21454 let mut unstructured = Unstructured::new(&buf);
21455 Self::arbitrary(&mut unstructured).unwrap_or_default()
21456 }
21457}
21458impl Default for MISSION_SET_CURRENT_DATA {
21459 fn default() -> Self {
21460 Self::DEFAULT.clone()
21461 }
21462}
21463impl MessageData for MISSION_SET_CURRENT_DATA {
21464 type Message = MavMessage;
21465 const ID: u32 = 41u32;
21466 const NAME: &'static str = "MISSION_SET_CURRENT";
21467 const EXTRA_CRC: u8 = 28u8;
21468 const ENCODED_LEN: usize = 4usize;
21469 fn deser(
21470 _version: MavlinkVersion,
21471 __input: &[u8],
21472 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21473 let avail_len = __input.len();
21474 let mut payload_buf = [0; Self::ENCODED_LEN];
21475 let mut buf = if avail_len < Self::ENCODED_LEN {
21476 payload_buf[0..avail_len].copy_from_slice(__input);
21477 Bytes::new(&payload_buf)
21478 } else {
21479 Bytes::new(__input)
21480 };
21481 let mut __struct = Self::default();
21482 __struct.seq = buf.get_u16_le();
21483 __struct.target_system = buf.get_u8();
21484 __struct.target_component = buf.get_u8();
21485 Ok(__struct)
21486 }
21487 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21488 let mut __tmp = BytesMut::new(bytes);
21489 #[allow(clippy::absurd_extreme_comparisons)]
21490 #[allow(unused_comparisons)]
21491 if __tmp.remaining() < Self::ENCODED_LEN {
21492 panic!(
21493 "buffer is too small (need {} bytes, but got {})",
21494 Self::ENCODED_LEN,
21495 __tmp.remaining(),
21496 )
21497 }
21498 __tmp.put_u16_le(self.seq);
21499 __tmp.put_u8(self.target_system);
21500 __tmp.put_u8(self.target_component);
21501 if matches!(version, MavlinkVersion::V2) {
21502 let len = __tmp.len();
21503 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21504 } else {
21505 __tmp.len()
21506 }
21507 }
21508}
21509#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
21510#[doc = ""]
21511#[doc = "ID: 38"]
21512#[derive(Debug, Clone, PartialEq)]
21513#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21515#[cfg_attr(feature = "ts", derive(TS))]
21516#[cfg_attr(feature = "ts", ts(export))]
21517pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
21518 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
21519 pub start_index: i16,
21520 #[doc = "End index, equal or greater than start index."]
21521 pub end_index: i16,
21522 #[doc = "System ID"]
21523 pub target_system: u8,
21524 #[doc = "Component ID"]
21525 pub target_component: u8,
21526 #[doc = "Mission type."]
21527 #[cfg_attr(feature = "serde", serde(default))]
21528 pub mission_type: MavMissionType,
21529}
21530impl MISSION_WRITE_PARTIAL_LIST_DATA {
21531 pub const ENCODED_LEN: usize = 7usize;
21532 pub const DEFAULT: Self = Self {
21533 start_index: 0_i16,
21534 end_index: 0_i16,
21535 target_system: 0_u8,
21536 target_component: 0_u8,
21537 mission_type: MavMissionType::DEFAULT,
21538 };
21539 #[cfg(feature = "arbitrary")]
21540 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21541 use arbitrary::{Arbitrary, Unstructured};
21542 let mut buf = [0u8; 1024];
21543 rng.fill_bytes(&mut buf);
21544 let mut unstructured = Unstructured::new(&buf);
21545 Self::arbitrary(&mut unstructured).unwrap_or_default()
21546 }
21547}
21548impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
21549 fn default() -> Self {
21550 Self::DEFAULT.clone()
21551 }
21552}
21553impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
21554 type Message = MavMessage;
21555 const ID: u32 = 38u32;
21556 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
21557 const EXTRA_CRC: u8 = 9u8;
21558 const ENCODED_LEN: usize = 7usize;
21559 fn deser(
21560 _version: MavlinkVersion,
21561 __input: &[u8],
21562 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21563 let avail_len = __input.len();
21564 let mut payload_buf = [0; Self::ENCODED_LEN];
21565 let mut buf = if avail_len < Self::ENCODED_LEN {
21566 payload_buf[0..avail_len].copy_from_slice(__input);
21567 Bytes::new(&payload_buf)
21568 } else {
21569 Bytes::new(__input)
21570 };
21571 let mut __struct = Self::default();
21572 __struct.start_index = buf.get_i16_le();
21573 __struct.end_index = buf.get_i16_le();
21574 __struct.target_system = buf.get_u8();
21575 __struct.target_component = buf.get_u8();
21576 let tmp = buf.get_u8();
21577 __struct.mission_type =
21578 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21579 enum_type: "MavMissionType",
21580 value: tmp as u32,
21581 })?;
21582 Ok(__struct)
21583 }
21584 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21585 let mut __tmp = BytesMut::new(bytes);
21586 #[allow(clippy::absurd_extreme_comparisons)]
21587 #[allow(unused_comparisons)]
21588 if __tmp.remaining() < Self::ENCODED_LEN {
21589 panic!(
21590 "buffer is too small (need {} bytes, but got {})",
21591 Self::ENCODED_LEN,
21592 __tmp.remaining(),
21593 )
21594 }
21595 __tmp.put_i16_le(self.start_index);
21596 __tmp.put_i16_le(self.end_index);
21597 __tmp.put_u8(self.target_system);
21598 __tmp.put_u8(self.target_component);
21599 if matches!(version, MavlinkVersion::V2) {
21600 __tmp.put_u8(self.mission_type as u8);
21601 let len = __tmp.len();
21602 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21603 } else {
21604 __tmp.len()
21605 }
21606 }
21607}
21608#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
21609#[doc = "Orientation of a mount."]
21610#[doc = ""]
21611#[doc = "ID: 265"]
21612#[derive(Debug, Clone, PartialEq)]
21613#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21614#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21615#[cfg_attr(feature = "ts", derive(TS))]
21616#[cfg_attr(feature = "ts", ts(export))]
21617pub struct MOUNT_ORIENTATION_DATA {
21618 #[doc = "Timestamp (time since system boot)."]
21619 pub time_boot_ms: u32,
21620 #[doc = "Roll in global frame (set to NaN for invalid)."]
21621 pub roll: f32,
21622 #[doc = "Pitch in global frame (set to NaN for invalid)."]
21623 pub pitch: f32,
21624 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
21625 pub yaw: f32,
21626 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
21627 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21628 pub yaw_absolute: f32,
21629}
21630impl MOUNT_ORIENTATION_DATA {
21631 pub const ENCODED_LEN: usize = 20usize;
21632 pub const DEFAULT: Self = Self {
21633 time_boot_ms: 0_u32,
21634 roll: 0.0_f32,
21635 pitch: 0.0_f32,
21636 yaw: 0.0_f32,
21637 yaw_absolute: 0.0_f32,
21638 };
21639 #[cfg(feature = "arbitrary")]
21640 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21641 use arbitrary::{Arbitrary, Unstructured};
21642 let mut buf = [0u8; 1024];
21643 rng.fill_bytes(&mut buf);
21644 let mut unstructured = Unstructured::new(&buf);
21645 Self::arbitrary(&mut unstructured).unwrap_or_default()
21646 }
21647}
21648impl Default for MOUNT_ORIENTATION_DATA {
21649 fn default() -> Self {
21650 Self::DEFAULT.clone()
21651 }
21652}
21653impl MessageData for MOUNT_ORIENTATION_DATA {
21654 type Message = MavMessage;
21655 const ID: u32 = 265u32;
21656 const NAME: &'static str = "MOUNT_ORIENTATION";
21657 const EXTRA_CRC: u8 = 26u8;
21658 const ENCODED_LEN: usize = 20usize;
21659 fn deser(
21660 _version: MavlinkVersion,
21661 __input: &[u8],
21662 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21663 let avail_len = __input.len();
21664 let mut payload_buf = [0; Self::ENCODED_LEN];
21665 let mut buf = if avail_len < Self::ENCODED_LEN {
21666 payload_buf[0..avail_len].copy_from_slice(__input);
21667 Bytes::new(&payload_buf)
21668 } else {
21669 Bytes::new(__input)
21670 };
21671 let mut __struct = Self::default();
21672 __struct.time_boot_ms = buf.get_u32_le();
21673 __struct.roll = buf.get_f32_le();
21674 __struct.pitch = buf.get_f32_le();
21675 __struct.yaw = buf.get_f32_le();
21676 __struct.yaw_absolute = buf.get_f32_le();
21677 Ok(__struct)
21678 }
21679 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21680 let mut __tmp = BytesMut::new(bytes);
21681 #[allow(clippy::absurd_extreme_comparisons)]
21682 #[allow(unused_comparisons)]
21683 if __tmp.remaining() < Self::ENCODED_LEN {
21684 panic!(
21685 "buffer is too small (need {} bytes, but got {})",
21686 Self::ENCODED_LEN,
21687 __tmp.remaining(),
21688 )
21689 }
21690 __tmp.put_u32_le(self.time_boot_ms);
21691 __tmp.put_f32_le(self.roll);
21692 __tmp.put_f32_le(self.pitch);
21693 __tmp.put_f32_le(self.yaw);
21694 if matches!(version, MavlinkVersion::V2) {
21695 __tmp.put_f32_le(self.yaw_absolute);
21696 let len = __tmp.len();
21697 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21698 } else {
21699 __tmp.len()
21700 }
21701 }
21702}
21703#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21704#[doc = ""]
21705#[doc = "ID: 251"]
21706#[derive(Debug, Clone, PartialEq)]
21707#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21708#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21709#[cfg_attr(feature = "ts", derive(TS))]
21710#[cfg_attr(feature = "ts", ts(export))]
21711pub struct NAMED_VALUE_FLOAT_DATA {
21712 #[doc = "Timestamp (time since system boot)."]
21713 pub time_boot_ms: u32,
21714 #[doc = "Floating point value"]
21715 pub value: f32,
21716 #[doc = "Name of the debug variable"]
21717 #[cfg_attr(
21718 feature = "serde",
21719 serde(
21720 serialize_with = "crate::nulstr::serialize::<_, 10>",
21721 deserialize_with = "crate::nulstr::deserialize::<_, 10>"
21722 )
21723 )]
21724 #[cfg_attr(feature = "ts", ts(type = "string"))]
21725 pub name: [u8; 10],
21726}
21727impl NAMED_VALUE_FLOAT_DATA {
21728 pub const ENCODED_LEN: usize = 18usize;
21729 pub const DEFAULT: Self = Self {
21730 time_boot_ms: 0_u32,
21731 value: 0.0_f32,
21732 name: [0_u8; 10usize],
21733 };
21734 #[cfg(feature = "arbitrary")]
21735 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21736 use arbitrary::{Arbitrary, Unstructured};
21737 let mut buf = [0u8; 1024];
21738 rng.fill_bytes(&mut buf);
21739 let mut unstructured = Unstructured::new(&buf);
21740 Self::arbitrary(&mut unstructured).unwrap_or_default()
21741 }
21742}
21743impl Default for NAMED_VALUE_FLOAT_DATA {
21744 fn default() -> Self {
21745 Self::DEFAULT.clone()
21746 }
21747}
21748impl MessageData for NAMED_VALUE_FLOAT_DATA {
21749 type Message = MavMessage;
21750 const ID: u32 = 251u32;
21751 const NAME: &'static str = "NAMED_VALUE_FLOAT";
21752 const EXTRA_CRC: u8 = 170u8;
21753 const ENCODED_LEN: usize = 18usize;
21754 fn deser(
21755 _version: MavlinkVersion,
21756 __input: &[u8],
21757 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21758 let avail_len = __input.len();
21759 let mut payload_buf = [0; Self::ENCODED_LEN];
21760 let mut buf = if avail_len < Self::ENCODED_LEN {
21761 payload_buf[0..avail_len].copy_from_slice(__input);
21762 Bytes::new(&payload_buf)
21763 } else {
21764 Bytes::new(__input)
21765 };
21766 let mut __struct = Self::default();
21767 __struct.time_boot_ms = buf.get_u32_le();
21768 __struct.value = buf.get_f32_le();
21769 for v in &mut __struct.name {
21770 let val = buf.get_u8();
21771 *v = val;
21772 }
21773 Ok(__struct)
21774 }
21775 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21776 let mut __tmp = BytesMut::new(bytes);
21777 #[allow(clippy::absurd_extreme_comparisons)]
21778 #[allow(unused_comparisons)]
21779 if __tmp.remaining() < Self::ENCODED_LEN {
21780 panic!(
21781 "buffer is too small (need {} bytes, but got {})",
21782 Self::ENCODED_LEN,
21783 __tmp.remaining(),
21784 )
21785 }
21786 __tmp.put_u32_le(self.time_boot_ms);
21787 __tmp.put_f32_le(self.value);
21788 for val in &self.name {
21789 __tmp.put_u8(*val);
21790 }
21791 if matches!(version, MavlinkVersion::V2) {
21792 let len = __tmp.len();
21793 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21794 } else {
21795 __tmp.len()
21796 }
21797 }
21798}
21799#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21800#[doc = ""]
21801#[doc = "ID: 252"]
21802#[derive(Debug, Clone, PartialEq)]
21803#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21804#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21805#[cfg_attr(feature = "ts", derive(TS))]
21806#[cfg_attr(feature = "ts", ts(export))]
21807pub struct NAMED_VALUE_INT_DATA {
21808 #[doc = "Timestamp (time since system boot)."]
21809 pub time_boot_ms: u32,
21810 #[doc = "Signed integer value"]
21811 pub value: i32,
21812 #[doc = "Name of the debug variable"]
21813 #[cfg_attr(
21814 feature = "serde",
21815 serde(
21816 serialize_with = "crate::nulstr::serialize::<_, 10>",
21817 deserialize_with = "crate::nulstr::deserialize::<_, 10>"
21818 )
21819 )]
21820 #[cfg_attr(feature = "ts", ts(type = "string"))]
21821 pub name: [u8; 10],
21822}
21823impl NAMED_VALUE_INT_DATA {
21824 pub const ENCODED_LEN: usize = 18usize;
21825 pub const DEFAULT: Self = Self {
21826 time_boot_ms: 0_u32,
21827 value: 0_i32,
21828 name: [0_u8; 10usize],
21829 };
21830 #[cfg(feature = "arbitrary")]
21831 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21832 use arbitrary::{Arbitrary, Unstructured};
21833 let mut buf = [0u8; 1024];
21834 rng.fill_bytes(&mut buf);
21835 let mut unstructured = Unstructured::new(&buf);
21836 Self::arbitrary(&mut unstructured).unwrap_or_default()
21837 }
21838}
21839impl Default for NAMED_VALUE_INT_DATA {
21840 fn default() -> Self {
21841 Self::DEFAULT.clone()
21842 }
21843}
21844impl MessageData for NAMED_VALUE_INT_DATA {
21845 type Message = MavMessage;
21846 const ID: u32 = 252u32;
21847 const NAME: &'static str = "NAMED_VALUE_INT";
21848 const EXTRA_CRC: u8 = 44u8;
21849 const ENCODED_LEN: usize = 18usize;
21850 fn deser(
21851 _version: MavlinkVersion,
21852 __input: &[u8],
21853 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21854 let avail_len = __input.len();
21855 let mut payload_buf = [0; Self::ENCODED_LEN];
21856 let mut buf = if avail_len < Self::ENCODED_LEN {
21857 payload_buf[0..avail_len].copy_from_slice(__input);
21858 Bytes::new(&payload_buf)
21859 } else {
21860 Bytes::new(__input)
21861 };
21862 let mut __struct = Self::default();
21863 __struct.time_boot_ms = buf.get_u32_le();
21864 __struct.value = buf.get_i32_le();
21865 for v in &mut __struct.name {
21866 let val = buf.get_u8();
21867 *v = val;
21868 }
21869 Ok(__struct)
21870 }
21871 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21872 let mut __tmp = BytesMut::new(bytes);
21873 #[allow(clippy::absurd_extreme_comparisons)]
21874 #[allow(unused_comparisons)]
21875 if __tmp.remaining() < Self::ENCODED_LEN {
21876 panic!(
21877 "buffer is too small (need {} bytes, but got {})",
21878 Self::ENCODED_LEN,
21879 __tmp.remaining(),
21880 )
21881 }
21882 __tmp.put_u32_le(self.time_boot_ms);
21883 __tmp.put_i32_le(self.value);
21884 for val in &self.name {
21885 __tmp.put_u8(*val);
21886 }
21887 if matches!(version, MavlinkVersion::V2) {
21888 let len = __tmp.len();
21889 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21890 } else {
21891 __tmp.len()
21892 }
21893 }
21894}
21895#[doc = "The state of the navigation and position controller."]
21896#[doc = ""]
21897#[doc = "ID: 62"]
21898#[derive(Debug, Clone, PartialEq)]
21899#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21900#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21901#[cfg_attr(feature = "ts", derive(TS))]
21902#[cfg_attr(feature = "ts", ts(export))]
21903pub struct NAV_CONTROLLER_OUTPUT_DATA {
21904 #[doc = "Current desired roll"]
21905 pub nav_roll: f32,
21906 #[doc = "Current desired pitch"]
21907 pub nav_pitch: f32,
21908 #[doc = "Current altitude error"]
21909 pub alt_error: f32,
21910 #[doc = "Current airspeed error"]
21911 pub aspd_error: f32,
21912 #[doc = "Current crosstrack error on x-y plane"]
21913 pub xtrack_error: f32,
21914 #[doc = "Current desired heading"]
21915 pub nav_bearing: i16,
21916 #[doc = "Bearing to current waypoint/target"]
21917 pub target_bearing: i16,
21918 #[doc = "Distance to active waypoint"]
21919 pub wp_dist: u16,
21920}
21921impl NAV_CONTROLLER_OUTPUT_DATA {
21922 pub const ENCODED_LEN: usize = 26usize;
21923 pub const DEFAULT: Self = Self {
21924 nav_roll: 0.0_f32,
21925 nav_pitch: 0.0_f32,
21926 alt_error: 0.0_f32,
21927 aspd_error: 0.0_f32,
21928 xtrack_error: 0.0_f32,
21929 nav_bearing: 0_i16,
21930 target_bearing: 0_i16,
21931 wp_dist: 0_u16,
21932 };
21933 #[cfg(feature = "arbitrary")]
21934 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21935 use arbitrary::{Arbitrary, Unstructured};
21936 let mut buf = [0u8; 1024];
21937 rng.fill_bytes(&mut buf);
21938 let mut unstructured = Unstructured::new(&buf);
21939 Self::arbitrary(&mut unstructured).unwrap_or_default()
21940 }
21941}
21942impl Default for NAV_CONTROLLER_OUTPUT_DATA {
21943 fn default() -> Self {
21944 Self::DEFAULT.clone()
21945 }
21946}
21947impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
21948 type Message = MavMessage;
21949 const ID: u32 = 62u32;
21950 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
21951 const EXTRA_CRC: u8 = 183u8;
21952 const ENCODED_LEN: usize = 26usize;
21953 fn deser(
21954 _version: MavlinkVersion,
21955 __input: &[u8],
21956 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21957 let avail_len = __input.len();
21958 let mut payload_buf = [0; Self::ENCODED_LEN];
21959 let mut buf = if avail_len < Self::ENCODED_LEN {
21960 payload_buf[0..avail_len].copy_from_slice(__input);
21961 Bytes::new(&payload_buf)
21962 } else {
21963 Bytes::new(__input)
21964 };
21965 let mut __struct = Self::default();
21966 __struct.nav_roll = buf.get_f32_le();
21967 __struct.nav_pitch = buf.get_f32_le();
21968 __struct.alt_error = buf.get_f32_le();
21969 __struct.aspd_error = buf.get_f32_le();
21970 __struct.xtrack_error = buf.get_f32_le();
21971 __struct.nav_bearing = buf.get_i16_le();
21972 __struct.target_bearing = buf.get_i16_le();
21973 __struct.wp_dist = buf.get_u16_le();
21974 Ok(__struct)
21975 }
21976 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21977 let mut __tmp = BytesMut::new(bytes);
21978 #[allow(clippy::absurd_extreme_comparisons)]
21979 #[allow(unused_comparisons)]
21980 if __tmp.remaining() < Self::ENCODED_LEN {
21981 panic!(
21982 "buffer is too small (need {} bytes, but got {})",
21983 Self::ENCODED_LEN,
21984 __tmp.remaining(),
21985 )
21986 }
21987 __tmp.put_f32_le(self.nav_roll);
21988 __tmp.put_f32_le(self.nav_pitch);
21989 __tmp.put_f32_le(self.alt_error);
21990 __tmp.put_f32_le(self.aspd_error);
21991 __tmp.put_f32_le(self.xtrack_error);
21992 __tmp.put_i16_le(self.nav_bearing);
21993 __tmp.put_i16_le(self.target_bearing);
21994 __tmp.put_u16_le(self.wp_dist);
21995 if matches!(version, MavlinkVersion::V2) {
21996 let len = __tmp.len();
21997 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21998 } else {
21999 __tmp.len()
22000 }
22001 }
22002}
22003#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
22004#[doc = ""]
22005#[doc = "ID: 330"]
22006#[derive(Debug, Clone, PartialEq)]
22007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22008#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22009#[cfg_attr(feature = "ts", derive(TS))]
22010#[cfg_attr(feature = "ts", ts(export))]
22011pub struct OBSTACLE_DISTANCE_DATA {
22012 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22013 pub time_usec: u64,
22014 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
22015 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22016 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22017 pub distances: [u16; 72],
22018 #[doc = "Minimum distance the sensor can measure."]
22019 pub min_distance: u16,
22020 #[doc = "Maximum distance the sensor can measure."]
22021 pub max_distance: u16,
22022 #[doc = "Class id of the distance sensor type."]
22023 pub sensor_type: MavDistanceSensor,
22024 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
22025 pub increment: u8,
22026 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
22027 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22028 pub increment_f: f32,
22029 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
22030 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22031 pub angle_offset: f32,
22032 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
22033 #[cfg_attr(feature = "serde", serde(default))]
22034 pub frame: MavFrame,
22035}
22036impl OBSTACLE_DISTANCE_DATA {
22037 pub const ENCODED_LEN: usize = 167usize;
22038 pub const DEFAULT: Self = Self {
22039 time_usec: 0_u64,
22040 distances: [0_u16; 72usize],
22041 min_distance: 0_u16,
22042 max_distance: 0_u16,
22043 sensor_type: MavDistanceSensor::DEFAULT,
22044 increment: 0_u8,
22045 increment_f: 0.0_f32,
22046 angle_offset: 0.0_f32,
22047 frame: MavFrame::DEFAULT,
22048 };
22049 #[cfg(feature = "arbitrary")]
22050 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22051 use arbitrary::{Arbitrary, Unstructured};
22052 let mut buf = [0u8; 1024];
22053 rng.fill_bytes(&mut buf);
22054 let mut unstructured = Unstructured::new(&buf);
22055 Self::arbitrary(&mut unstructured).unwrap_or_default()
22056 }
22057}
22058impl Default for OBSTACLE_DISTANCE_DATA {
22059 fn default() -> Self {
22060 Self::DEFAULT.clone()
22061 }
22062}
22063impl MessageData for OBSTACLE_DISTANCE_DATA {
22064 type Message = MavMessage;
22065 const ID: u32 = 330u32;
22066 const NAME: &'static str = "OBSTACLE_DISTANCE";
22067 const EXTRA_CRC: u8 = 23u8;
22068 const ENCODED_LEN: usize = 167usize;
22069 fn deser(
22070 _version: MavlinkVersion,
22071 __input: &[u8],
22072 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22073 let avail_len = __input.len();
22074 let mut payload_buf = [0; Self::ENCODED_LEN];
22075 let mut buf = if avail_len < Self::ENCODED_LEN {
22076 payload_buf[0..avail_len].copy_from_slice(__input);
22077 Bytes::new(&payload_buf)
22078 } else {
22079 Bytes::new(__input)
22080 };
22081 let mut __struct = Self::default();
22082 __struct.time_usec = buf.get_u64_le();
22083 for v in &mut __struct.distances {
22084 let val = buf.get_u16_le();
22085 *v = val;
22086 }
22087 __struct.min_distance = buf.get_u16_le();
22088 __struct.max_distance = buf.get_u16_le();
22089 let tmp = buf.get_u8();
22090 __struct.sensor_type =
22091 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22092 enum_type: "MavDistanceSensor",
22093 value: tmp as u32,
22094 })?;
22095 __struct.increment = buf.get_u8();
22096 __struct.increment_f = buf.get_f32_le();
22097 __struct.angle_offset = buf.get_f32_le();
22098 let tmp = buf.get_u8();
22099 __struct.frame =
22100 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22101 enum_type: "MavFrame",
22102 value: tmp as u32,
22103 })?;
22104 Ok(__struct)
22105 }
22106 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22107 let mut __tmp = BytesMut::new(bytes);
22108 #[allow(clippy::absurd_extreme_comparisons)]
22109 #[allow(unused_comparisons)]
22110 if __tmp.remaining() < Self::ENCODED_LEN {
22111 panic!(
22112 "buffer is too small (need {} bytes, but got {})",
22113 Self::ENCODED_LEN,
22114 __tmp.remaining(),
22115 )
22116 }
22117 __tmp.put_u64_le(self.time_usec);
22118 for val in &self.distances {
22119 __tmp.put_u16_le(*val);
22120 }
22121 __tmp.put_u16_le(self.min_distance);
22122 __tmp.put_u16_le(self.max_distance);
22123 __tmp.put_u8(self.sensor_type as u8);
22124 __tmp.put_u8(self.increment);
22125 if matches!(version, MavlinkVersion::V2) {
22126 __tmp.put_f32_le(self.increment_f);
22127 __tmp.put_f32_le(self.angle_offset);
22128 __tmp.put_u8(self.frame as u8);
22129 let len = __tmp.len();
22130 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22131 } else {
22132 __tmp.len()
22133 }
22134 }
22135}
22136#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
22137#[doc = ""]
22138#[doc = "ID: 331"]
22139#[derive(Debug, Clone, PartialEq)]
22140#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22141#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22142#[cfg_attr(feature = "ts", derive(TS))]
22143#[cfg_attr(feature = "ts", ts(export))]
22144pub struct ODOMETRY_DATA {
22145 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22146 pub time_usec: u64,
22147 #[doc = "X Position"]
22148 pub x: f32,
22149 #[doc = "Y Position"]
22150 pub y: f32,
22151 #[doc = "Z Position"]
22152 pub z: f32,
22153 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
22154 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22155 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22156 pub q: [f32; 4],
22157 #[doc = "X linear speed"]
22158 pub vx: f32,
22159 #[doc = "Y linear speed"]
22160 pub vy: f32,
22161 #[doc = "Z linear speed"]
22162 pub vz: f32,
22163 #[doc = "Roll angular speed"]
22164 pub rollspeed: f32,
22165 #[doc = "Pitch angular speed"]
22166 pub pitchspeed: f32,
22167 #[doc = "Yaw angular speed"]
22168 pub yawspeed: f32,
22169 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
22170 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22171 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22172 pub pose_covariance: [f32; 21],
22173 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
22174 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22175 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22176 pub velocity_covariance: [f32; 21],
22177 #[doc = "Coordinate frame of reference for the pose data."]
22178 pub frame_id: MavFrame,
22179 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
22180 pub child_frame_id: MavFrame,
22181 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
22182 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22183 pub reset_counter: u8,
22184 #[doc = "Type of estimator that is providing the odometry."]
22185 #[cfg_attr(feature = "serde", serde(default))]
22186 pub estimator_type: MavEstimatorType,
22187 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
22188 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22189 pub quality: i8,
22190}
22191impl ODOMETRY_DATA {
22192 pub const ENCODED_LEN: usize = 233usize;
22193 pub const DEFAULT: Self = Self {
22194 time_usec: 0_u64,
22195 x: 0.0_f32,
22196 y: 0.0_f32,
22197 z: 0.0_f32,
22198 q: [0.0_f32; 4usize],
22199 vx: 0.0_f32,
22200 vy: 0.0_f32,
22201 vz: 0.0_f32,
22202 rollspeed: 0.0_f32,
22203 pitchspeed: 0.0_f32,
22204 yawspeed: 0.0_f32,
22205 pose_covariance: [0.0_f32; 21usize],
22206 velocity_covariance: [0.0_f32; 21usize],
22207 frame_id: MavFrame::DEFAULT,
22208 child_frame_id: MavFrame::DEFAULT,
22209 reset_counter: 0_u8,
22210 estimator_type: MavEstimatorType::DEFAULT,
22211 quality: 0_i8,
22212 };
22213 #[cfg(feature = "arbitrary")]
22214 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22215 use arbitrary::{Arbitrary, Unstructured};
22216 let mut buf = [0u8; 1024];
22217 rng.fill_bytes(&mut buf);
22218 let mut unstructured = Unstructured::new(&buf);
22219 Self::arbitrary(&mut unstructured).unwrap_or_default()
22220 }
22221}
22222impl Default for ODOMETRY_DATA {
22223 fn default() -> Self {
22224 Self::DEFAULT.clone()
22225 }
22226}
22227impl MessageData for ODOMETRY_DATA {
22228 type Message = MavMessage;
22229 const ID: u32 = 331u32;
22230 const NAME: &'static str = "ODOMETRY";
22231 const EXTRA_CRC: u8 = 91u8;
22232 const ENCODED_LEN: usize = 233usize;
22233 fn deser(
22234 _version: MavlinkVersion,
22235 __input: &[u8],
22236 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22237 let avail_len = __input.len();
22238 let mut payload_buf = [0; Self::ENCODED_LEN];
22239 let mut buf = if avail_len < Self::ENCODED_LEN {
22240 payload_buf[0..avail_len].copy_from_slice(__input);
22241 Bytes::new(&payload_buf)
22242 } else {
22243 Bytes::new(__input)
22244 };
22245 let mut __struct = Self::default();
22246 __struct.time_usec = buf.get_u64_le();
22247 __struct.x = buf.get_f32_le();
22248 __struct.y = buf.get_f32_le();
22249 __struct.z = buf.get_f32_le();
22250 for v in &mut __struct.q {
22251 let val = buf.get_f32_le();
22252 *v = val;
22253 }
22254 __struct.vx = buf.get_f32_le();
22255 __struct.vy = buf.get_f32_le();
22256 __struct.vz = buf.get_f32_le();
22257 __struct.rollspeed = buf.get_f32_le();
22258 __struct.pitchspeed = buf.get_f32_le();
22259 __struct.yawspeed = buf.get_f32_le();
22260 for v in &mut __struct.pose_covariance {
22261 let val = buf.get_f32_le();
22262 *v = val;
22263 }
22264 for v in &mut __struct.velocity_covariance {
22265 let val = buf.get_f32_le();
22266 *v = val;
22267 }
22268 let tmp = buf.get_u8();
22269 __struct.frame_id =
22270 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22271 enum_type: "MavFrame",
22272 value: tmp as u32,
22273 })?;
22274 let tmp = buf.get_u8();
22275 __struct.child_frame_id =
22276 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22277 enum_type: "MavFrame",
22278 value: tmp as u32,
22279 })?;
22280 __struct.reset_counter = buf.get_u8();
22281 let tmp = buf.get_u8();
22282 __struct.estimator_type =
22283 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22284 enum_type: "MavEstimatorType",
22285 value: tmp as u32,
22286 })?;
22287 __struct.quality = buf.get_i8();
22288 Ok(__struct)
22289 }
22290 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22291 let mut __tmp = BytesMut::new(bytes);
22292 #[allow(clippy::absurd_extreme_comparisons)]
22293 #[allow(unused_comparisons)]
22294 if __tmp.remaining() < Self::ENCODED_LEN {
22295 panic!(
22296 "buffer is too small (need {} bytes, but got {})",
22297 Self::ENCODED_LEN,
22298 __tmp.remaining(),
22299 )
22300 }
22301 __tmp.put_u64_le(self.time_usec);
22302 __tmp.put_f32_le(self.x);
22303 __tmp.put_f32_le(self.y);
22304 __tmp.put_f32_le(self.z);
22305 for val in &self.q {
22306 __tmp.put_f32_le(*val);
22307 }
22308 __tmp.put_f32_le(self.vx);
22309 __tmp.put_f32_le(self.vy);
22310 __tmp.put_f32_le(self.vz);
22311 __tmp.put_f32_le(self.rollspeed);
22312 __tmp.put_f32_le(self.pitchspeed);
22313 __tmp.put_f32_le(self.yawspeed);
22314 for val in &self.pose_covariance {
22315 __tmp.put_f32_le(*val);
22316 }
22317 for val in &self.velocity_covariance {
22318 __tmp.put_f32_le(*val);
22319 }
22320 __tmp.put_u8(self.frame_id as u8);
22321 __tmp.put_u8(self.child_frame_id as u8);
22322 if matches!(version, MavlinkVersion::V2) {
22323 __tmp.put_u8(self.reset_counter);
22324 __tmp.put_u8(self.estimator_type as u8);
22325 __tmp.put_i8(self.quality);
22326 let len = __tmp.len();
22327 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22328 } else {
22329 __tmp.len()
22330 }
22331 }
22332}
22333#[doc = "Hardware status sent by an onboard computer."]
22334#[doc = ""]
22335#[doc = "ID: 390"]
22336#[derive(Debug, Clone, PartialEq)]
22337#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22338#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22339#[cfg_attr(feature = "ts", derive(TS))]
22340#[cfg_attr(feature = "ts", ts(export))]
22341pub struct ONBOARD_COMPUTER_STATUS_DATA {
22342 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22343 pub time_usec: u64,
22344 #[doc = "Time since system boot."]
22345 pub uptime: u32,
22346 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
22347 pub ram_usage: u32,
22348 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
22349 pub ram_total: u32,
22350 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
22351 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22352 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22353 pub storage_type: [u32; 4],
22354 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
22355 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22356 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22357 pub storage_usage: [u32; 4],
22358 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
22359 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22360 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22361 pub storage_total: [u32; 4],
22362 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
22363 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22364 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22365 pub link_type: [u32; 6],
22366 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
22367 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22368 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22369 pub link_tx_rate: [u32; 6],
22370 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
22371 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22372 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22373 pub link_rx_rate: [u32; 6],
22374 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
22375 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22376 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22377 pub link_tx_max: [u32; 6],
22378 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
22379 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22380 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22381 pub link_rx_max: [u32; 6],
22382 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
22383 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22384 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22385 pub fan_speed: [i16; 4],
22386 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
22387 pub mavtype: u8,
22388 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
22389 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22390 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22391 pub cpu_cores: [u8; 8],
22392 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
22393 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22394 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22395 pub cpu_combined: [u8; 10],
22396 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
22397 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22398 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22399 pub gpu_cores: [u8; 4],
22400 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
22401 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22402 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22403 pub gpu_combined: [u8; 10],
22404 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
22405 pub temperature_board: i8,
22406 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
22407 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22408 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22409 pub temperature_core: [i8; 8],
22410}
22411impl ONBOARD_COMPUTER_STATUS_DATA {
22412 pub const ENCODED_LEN: usize = 238usize;
22413 pub const DEFAULT: Self = Self {
22414 time_usec: 0_u64,
22415 uptime: 0_u32,
22416 ram_usage: 0_u32,
22417 ram_total: 0_u32,
22418 storage_type: [0_u32; 4usize],
22419 storage_usage: [0_u32; 4usize],
22420 storage_total: [0_u32; 4usize],
22421 link_type: [0_u32; 6usize],
22422 link_tx_rate: [0_u32; 6usize],
22423 link_rx_rate: [0_u32; 6usize],
22424 link_tx_max: [0_u32; 6usize],
22425 link_rx_max: [0_u32; 6usize],
22426 fan_speed: [0_i16; 4usize],
22427 mavtype: 0_u8,
22428 cpu_cores: [0_u8; 8usize],
22429 cpu_combined: [0_u8; 10usize],
22430 gpu_cores: [0_u8; 4usize],
22431 gpu_combined: [0_u8; 10usize],
22432 temperature_board: 0_i8,
22433 temperature_core: [0_i8; 8usize],
22434 };
22435 #[cfg(feature = "arbitrary")]
22436 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22437 use arbitrary::{Arbitrary, Unstructured};
22438 let mut buf = [0u8; 1024];
22439 rng.fill_bytes(&mut buf);
22440 let mut unstructured = Unstructured::new(&buf);
22441 Self::arbitrary(&mut unstructured).unwrap_or_default()
22442 }
22443}
22444impl Default for ONBOARD_COMPUTER_STATUS_DATA {
22445 fn default() -> Self {
22446 Self::DEFAULT.clone()
22447 }
22448}
22449impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
22450 type Message = MavMessage;
22451 const ID: u32 = 390u32;
22452 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
22453 const EXTRA_CRC: u8 = 156u8;
22454 const ENCODED_LEN: usize = 238usize;
22455 fn deser(
22456 _version: MavlinkVersion,
22457 __input: &[u8],
22458 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22459 let avail_len = __input.len();
22460 let mut payload_buf = [0; Self::ENCODED_LEN];
22461 let mut buf = if avail_len < Self::ENCODED_LEN {
22462 payload_buf[0..avail_len].copy_from_slice(__input);
22463 Bytes::new(&payload_buf)
22464 } else {
22465 Bytes::new(__input)
22466 };
22467 let mut __struct = Self::default();
22468 __struct.time_usec = buf.get_u64_le();
22469 __struct.uptime = buf.get_u32_le();
22470 __struct.ram_usage = buf.get_u32_le();
22471 __struct.ram_total = buf.get_u32_le();
22472 for v in &mut __struct.storage_type {
22473 let val = buf.get_u32_le();
22474 *v = val;
22475 }
22476 for v in &mut __struct.storage_usage {
22477 let val = buf.get_u32_le();
22478 *v = val;
22479 }
22480 for v in &mut __struct.storage_total {
22481 let val = buf.get_u32_le();
22482 *v = val;
22483 }
22484 for v in &mut __struct.link_type {
22485 let val = buf.get_u32_le();
22486 *v = val;
22487 }
22488 for v in &mut __struct.link_tx_rate {
22489 let val = buf.get_u32_le();
22490 *v = val;
22491 }
22492 for v in &mut __struct.link_rx_rate {
22493 let val = buf.get_u32_le();
22494 *v = val;
22495 }
22496 for v in &mut __struct.link_tx_max {
22497 let val = buf.get_u32_le();
22498 *v = val;
22499 }
22500 for v in &mut __struct.link_rx_max {
22501 let val = buf.get_u32_le();
22502 *v = val;
22503 }
22504 for v in &mut __struct.fan_speed {
22505 let val = buf.get_i16_le();
22506 *v = val;
22507 }
22508 __struct.mavtype = buf.get_u8();
22509 for v in &mut __struct.cpu_cores {
22510 let val = buf.get_u8();
22511 *v = val;
22512 }
22513 for v in &mut __struct.cpu_combined {
22514 let val = buf.get_u8();
22515 *v = val;
22516 }
22517 for v in &mut __struct.gpu_cores {
22518 let val = buf.get_u8();
22519 *v = val;
22520 }
22521 for v in &mut __struct.gpu_combined {
22522 let val = buf.get_u8();
22523 *v = val;
22524 }
22525 __struct.temperature_board = buf.get_i8();
22526 for v in &mut __struct.temperature_core {
22527 let val = buf.get_i8();
22528 *v = val;
22529 }
22530 Ok(__struct)
22531 }
22532 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22533 let mut __tmp = BytesMut::new(bytes);
22534 #[allow(clippy::absurd_extreme_comparisons)]
22535 #[allow(unused_comparisons)]
22536 if __tmp.remaining() < Self::ENCODED_LEN {
22537 panic!(
22538 "buffer is too small (need {} bytes, but got {})",
22539 Self::ENCODED_LEN,
22540 __tmp.remaining(),
22541 )
22542 }
22543 __tmp.put_u64_le(self.time_usec);
22544 __tmp.put_u32_le(self.uptime);
22545 __tmp.put_u32_le(self.ram_usage);
22546 __tmp.put_u32_le(self.ram_total);
22547 for val in &self.storage_type {
22548 __tmp.put_u32_le(*val);
22549 }
22550 for val in &self.storage_usage {
22551 __tmp.put_u32_le(*val);
22552 }
22553 for val in &self.storage_total {
22554 __tmp.put_u32_le(*val);
22555 }
22556 for val in &self.link_type {
22557 __tmp.put_u32_le(*val);
22558 }
22559 for val in &self.link_tx_rate {
22560 __tmp.put_u32_le(*val);
22561 }
22562 for val in &self.link_rx_rate {
22563 __tmp.put_u32_le(*val);
22564 }
22565 for val in &self.link_tx_max {
22566 __tmp.put_u32_le(*val);
22567 }
22568 for val in &self.link_rx_max {
22569 __tmp.put_u32_le(*val);
22570 }
22571 for val in &self.fan_speed {
22572 __tmp.put_i16_le(*val);
22573 }
22574 __tmp.put_u8(self.mavtype);
22575 for val in &self.cpu_cores {
22576 __tmp.put_u8(*val);
22577 }
22578 for val in &self.cpu_combined {
22579 __tmp.put_u8(*val);
22580 }
22581 for val in &self.gpu_cores {
22582 __tmp.put_u8(*val);
22583 }
22584 for val in &self.gpu_combined {
22585 __tmp.put_u8(*val);
22586 }
22587 __tmp.put_i8(self.temperature_board);
22588 for val in &self.temperature_core {
22589 __tmp.put_i8(*val);
22590 }
22591 if matches!(version, MavlinkVersion::V2) {
22592 let len = __tmp.len();
22593 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22594 } else {
22595 __tmp.len()
22596 }
22597 }
22598}
22599#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
22600#[doc = ""]
22601#[doc = "ID: 12918"]
22602#[derive(Debug, Clone, PartialEq)]
22603#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22604#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22605#[cfg_attr(feature = "ts", derive(TS))]
22606#[cfg_attr(feature = "ts", ts(export))]
22607pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
22608 #[doc = "Status level indicating if arming is allowed."]
22609 pub status: MavOdidArmStatus,
22610 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
22611 #[cfg_attr(
22612 feature = "serde",
22613 serde(
22614 serialize_with = "crate::nulstr::serialize::<_, 50>",
22615 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
22616 )
22617 )]
22618 #[cfg_attr(feature = "ts", ts(type = "string"))]
22619 pub error: [u8; 50],
22620}
22621impl OPEN_DRONE_ID_ARM_STATUS_DATA {
22622 pub const ENCODED_LEN: usize = 51usize;
22623 pub const DEFAULT: Self = Self {
22624 status: MavOdidArmStatus::DEFAULT,
22625 error: [0_u8; 50usize],
22626 };
22627 #[cfg(feature = "arbitrary")]
22628 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22629 use arbitrary::{Arbitrary, Unstructured};
22630 let mut buf = [0u8; 1024];
22631 rng.fill_bytes(&mut buf);
22632 let mut unstructured = Unstructured::new(&buf);
22633 Self::arbitrary(&mut unstructured).unwrap_or_default()
22634 }
22635}
22636impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
22637 fn default() -> Self {
22638 Self::DEFAULT.clone()
22639 }
22640}
22641impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
22642 type Message = MavMessage;
22643 const ID: u32 = 12918u32;
22644 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
22645 const EXTRA_CRC: u8 = 139u8;
22646 const ENCODED_LEN: usize = 51usize;
22647 fn deser(
22648 _version: MavlinkVersion,
22649 __input: &[u8],
22650 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22651 let avail_len = __input.len();
22652 let mut payload_buf = [0; Self::ENCODED_LEN];
22653 let mut buf = if avail_len < Self::ENCODED_LEN {
22654 payload_buf[0..avail_len].copy_from_slice(__input);
22655 Bytes::new(&payload_buf)
22656 } else {
22657 Bytes::new(__input)
22658 };
22659 let mut __struct = Self::default();
22660 let tmp = buf.get_u8();
22661 __struct.status =
22662 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22663 enum_type: "MavOdidArmStatus",
22664 value: tmp as u32,
22665 })?;
22666 for v in &mut __struct.error {
22667 let val = buf.get_u8();
22668 *v = val;
22669 }
22670 Ok(__struct)
22671 }
22672 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22673 let mut __tmp = BytesMut::new(bytes);
22674 #[allow(clippy::absurd_extreme_comparisons)]
22675 #[allow(unused_comparisons)]
22676 if __tmp.remaining() < Self::ENCODED_LEN {
22677 panic!(
22678 "buffer is too small (need {} bytes, but got {})",
22679 Self::ENCODED_LEN,
22680 __tmp.remaining(),
22681 )
22682 }
22683 __tmp.put_u8(self.status as u8);
22684 for val in &self.error {
22685 __tmp.put_u8(*val);
22686 }
22687 if matches!(version, MavlinkVersion::V2) {
22688 let len = __tmp.len();
22689 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22690 } else {
22691 __tmp.len()
22692 }
22693 }
22694}
22695#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
22696#[doc = ""]
22697#[doc = "ID: 12902"]
22698#[derive(Debug, Clone, PartialEq)]
22699#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22700#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22701#[cfg_attr(feature = "ts", derive(TS))]
22702#[cfg_attr(feature = "ts", ts(export))]
22703pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
22704 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22705 pub timestamp: u32,
22706 #[doc = "System ID (0 for broadcast)."]
22707 pub target_system: u8,
22708 #[doc = "Component ID (0 for broadcast)."]
22709 pub target_component: u8,
22710 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22711 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22712 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22713 pub id_or_mac: [u8; 20],
22714 #[doc = "Indicates the type of authentication."]
22715 pub authentication_type: MavOdidAuthType,
22716 #[doc = "Allowed range is 0 - 15."]
22717 pub data_page: u8,
22718 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22719 pub last_page_index: u8,
22720 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22721 pub length: u8,
22722 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
22723 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22724 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22725 pub authentication_data: [u8; 23],
22726}
22727impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
22728 pub const ENCODED_LEN: usize = 53usize;
22729 pub const DEFAULT: Self = Self {
22730 timestamp: 0_u32,
22731 target_system: 0_u8,
22732 target_component: 0_u8,
22733 id_or_mac: [0_u8; 20usize],
22734 authentication_type: MavOdidAuthType::DEFAULT,
22735 data_page: 0_u8,
22736 last_page_index: 0_u8,
22737 length: 0_u8,
22738 authentication_data: [0_u8; 23usize],
22739 };
22740 #[cfg(feature = "arbitrary")]
22741 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22742 use arbitrary::{Arbitrary, Unstructured};
22743 let mut buf = [0u8; 1024];
22744 rng.fill_bytes(&mut buf);
22745 let mut unstructured = Unstructured::new(&buf);
22746 Self::arbitrary(&mut unstructured).unwrap_or_default()
22747 }
22748}
22749impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22750 fn default() -> Self {
22751 Self::DEFAULT.clone()
22752 }
22753}
22754impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22755 type Message = MavMessage;
22756 const ID: u32 = 12902u32;
22757 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
22758 const EXTRA_CRC: u8 = 140u8;
22759 const ENCODED_LEN: usize = 53usize;
22760 fn deser(
22761 _version: MavlinkVersion,
22762 __input: &[u8],
22763 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22764 let avail_len = __input.len();
22765 let mut payload_buf = [0; Self::ENCODED_LEN];
22766 let mut buf = if avail_len < Self::ENCODED_LEN {
22767 payload_buf[0..avail_len].copy_from_slice(__input);
22768 Bytes::new(&payload_buf)
22769 } else {
22770 Bytes::new(__input)
22771 };
22772 let mut __struct = Self::default();
22773 __struct.timestamp = buf.get_u32_le();
22774 __struct.target_system = buf.get_u8();
22775 __struct.target_component = buf.get_u8();
22776 for v in &mut __struct.id_or_mac {
22777 let val = buf.get_u8();
22778 *v = val;
22779 }
22780 let tmp = buf.get_u8();
22781 __struct.authentication_type =
22782 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22783 enum_type: "MavOdidAuthType",
22784 value: tmp as u32,
22785 })?;
22786 __struct.data_page = buf.get_u8();
22787 __struct.last_page_index = buf.get_u8();
22788 __struct.length = buf.get_u8();
22789 for v in &mut __struct.authentication_data {
22790 let val = buf.get_u8();
22791 *v = val;
22792 }
22793 Ok(__struct)
22794 }
22795 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22796 let mut __tmp = BytesMut::new(bytes);
22797 #[allow(clippy::absurd_extreme_comparisons)]
22798 #[allow(unused_comparisons)]
22799 if __tmp.remaining() < Self::ENCODED_LEN {
22800 panic!(
22801 "buffer is too small (need {} bytes, but got {})",
22802 Self::ENCODED_LEN,
22803 __tmp.remaining(),
22804 )
22805 }
22806 __tmp.put_u32_le(self.timestamp);
22807 __tmp.put_u8(self.target_system);
22808 __tmp.put_u8(self.target_component);
22809 for val in &self.id_or_mac {
22810 __tmp.put_u8(*val);
22811 }
22812 __tmp.put_u8(self.authentication_type as u8);
22813 __tmp.put_u8(self.data_page);
22814 __tmp.put_u8(self.last_page_index);
22815 __tmp.put_u8(self.length);
22816 for val in &self.authentication_data {
22817 __tmp.put_u8(*val);
22818 }
22819 if matches!(version, MavlinkVersion::V2) {
22820 let len = __tmp.len();
22821 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22822 } else {
22823 __tmp.len()
22824 }
22825 }
22826}
22827#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
22828#[doc = ""]
22829#[doc = "ID: 12900"]
22830#[derive(Debug, Clone, PartialEq)]
22831#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22832#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22833#[cfg_attr(feature = "ts", derive(TS))]
22834#[cfg_attr(feature = "ts", ts(export))]
22835pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
22836 #[doc = "System ID (0 for broadcast)."]
22837 pub target_system: u8,
22838 #[doc = "Component ID (0 for broadcast)."]
22839 pub target_component: u8,
22840 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22841 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22842 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22843 pub id_or_mac: [u8; 20],
22844 #[doc = "Indicates the format for the uas_id field of this message."]
22845 pub id_type: MavOdidIdType,
22846 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
22847 pub ua_type: MavOdidUaType,
22848 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
22849 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22850 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22851 pub uas_id: [u8; 20],
22852}
22853impl OPEN_DRONE_ID_BASIC_ID_DATA {
22854 pub const ENCODED_LEN: usize = 44usize;
22855 pub const DEFAULT: Self = Self {
22856 target_system: 0_u8,
22857 target_component: 0_u8,
22858 id_or_mac: [0_u8; 20usize],
22859 id_type: MavOdidIdType::DEFAULT,
22860 ua_type: MavOdidUaType::DEFAULT,
22861 uas_id: [0_u8; 20usize],
22862 };
22863 #[cfg(feature = "arbitrary")]
22864 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22865 use arbitrary::{Arbitrary, Unstructured};
22866 let mut buf = [0u8; 1024];
22867 rng.fill_bytes(&mut buf);
22868 let mut unstructured = Unstructured::new(&buf);
22869 Self::arbitrary(&mut unstructured).unwrap_or_default()
22870 }
22871}
22872impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
22873 fn default() -> Self {
22874 Self::DEFAULT.clone()
22875 }
22876}
22877impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
22878 type Message = MavMessage;
22879 const ID: u32 = 12900u32;
22880 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
22881 const EXTRA_CRC: u8 = 114u8;
22882 const ENCODED_LEN: usize = 44usize;
22883 fn deser(
22884 _version: MavlinkVersion,
22885 __input: &[u8],
22886 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22887 let avail_len = __input.len();
22888 let mut payload_buf = [0; Self::ENCODED_LEN];
22889 let mut buf = if avail_len < Self::ENCODED_LEN {
22890 payload_buf[0..avail_len].copy_from_slice(__input);
22891 Bytes::new(&payload_buf)
22892 } else {
22893 Bytes::new(__input)
22894 };
22895 let mut __struct = Self::default();
22896 __struct.target_system = buf.get_u8();
22897 __struct.target_component = buf.get_u8();
22898 for v in &mut __struct.id_or_mac {
22899 let val = buf.get_u8();
22900 *v = val;
22901 }
22902 let tmp = buf.get_u8();
22903 __struct.id_type =
22904 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22905 enum_type: "MavOdidIdType",
22906 value: tmp as u32,
22907 })?;
22908 let tmp = buf.get_u8();
22909 __struct.ua_type =
22910 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22911 enum_type: "MavOdidUaType",
22912 value: tmp as u32,
22913 })?;
22914 for v in &mut __struct.uas_id {
22915 let val = buf.get_u8();
22916 *v = val;
22917 }
22918 Ok(__struct)
22919 }
22920 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22921 let mut __tmp = BytesMut::new(bytes);
22922 #[allow(clippy::absurd_extreme_comparisons)]
22923 #[allow(unused_comparisons)]
22924 if __tmp.remaining() < Self::ENCODED_LEN {
22925 panic!(
22926 "buffer is too small (need {} bytes, but got {})",
22927 Self::ENCODED_LEN,
22928 __tmp.remaining(),
22929 )
22930 }
22931 __tmp.put_u8(self.target_system);
22932 __tmp.put_u8(self.target_component);
22933 for val in &self.id_or_mac {
22934 __tmp.put_u8(*val);
22935 }
22936 __tmp.put_u8(self.id_type as u8);
22937 __tmp.put_u8(self.ua_type as u8);
22938 for val in &self.uas_id {
22939 __tmp.put_u8(*val);
22940 }
22941 if matches!(version, MavlinkVersion::V2) {
22942 let len = __tmp.len();
22943 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22944 } else {
22945 __tmp.len()
22946 }
22947 }
22948}
22949#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
22950#[doc = ""]
22951#[doc = "ID: 12901"]
22952#[derive(Debug, Clone, PartialEq)]
22953#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22954#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22955#[cfg_attr(feature = "ts", derive(TS))]
22956#[cfg_attr(feature = "ts", ts(export))]
22957pub struct OPEN_DRONE_ID_LOCATION_DATA {
22958 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22959 pub latitude: i32,
22960 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22961 pub longitude: i32,
22962 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
22963 pub altitude_barometric: f32,
22964 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
22965 pub altitude_geodetic: f32,
22966 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
22967 pub height: f32,
22968 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
22969 pub timestamp: f32,
22970 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
22971 pub direction: u16,
22972 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
22973 pub speed_horizontal: u16,
22974 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
22975 pub speed_vertical: i16,
22976 #[doc = "System ID (0 for broadcast)."]
22977 pub target_system: u8,
22978 #[doc = "Component ID (0 for broadcast)."]
22979 pub target_component: u8,
22980 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22981 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22982 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22983 pub id_or_mac: [u8; 20],
22984 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
22985 pub status: MavOdidStatus,
22986 #[doc = "Indicates the reference point for the height field."]
22987 pub height_reference: MavOdidHeightRef,
22988 #[doc = "The accuracy of the horizontal position."]
22989 pub horizontal_accuracy: MavOdidHorAcc,
22990 #[doc = "The accuracy of the vertical position."]
22991 pub vertical_accuracy: MavOdidVerAcc,
22992 #[doc = "The accuracy of the barometric altitude."]
22993 pub barometer_accuracy: MavOdidVerAcc,
22994 #[doc = "The accuracy of the horizontal and vertical speed."]
22995 pub speed_accuracy: MavOdidSpeedAcc,
22996 #[doc = "The accuracy of the timestamps."]
22997 pub timestamp_accuracy: MavOdidTimeAcc,
22998}
22999impl OPEN_DRONE_ID_LOCATION_DATA {
23000 pub const ENCODED_LEN: usize = 59usize;
23001 pub const DEFAULT: Self = Self {
23002 latitude: 0_i32,
23003 longitude: 0_i32,
23004 altitude_barometric: 0.0_f32,
23005 altitude_geodetic: 0.0_f32,
23006 height: 0.0_f32,
23007 timestamp: 0.0_f32,
23008 direction: 0_u16,
23009 speed_horizontal: 0_u16,
23010 speed_vertical: 0_i16,
23011 target_system: 0_u8,
23012 target_component: 0_u8,
23013 id_or_mac: [0_u8; 20usize],
23014 status: MavOdidStatus::DEFAULT,
23015 height_reference: MavOdidHeightRef::DEFAULT,
23016 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
23017 vertical_accuracy: MavOdidVerAcc::DEFAULT,
23018 barometer_accuracy: MavOdidVerAcc::DEFAULT,
23019 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
23020 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
23021 };
23022 #[cfg(feature = "arbitrary")]
23023 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23024 use arbitrary::{Arbitrary, Unstructured};
23025 let mut buf = [0u8; 1024];
23026 rng.fill_bytes(&mut buf);
23027 let mut unstructured = Unstructured::new(&buf);
23028 Self::arbitrary(&mut unstructured).unwrap_or_default()
23029 }
23030}
23031impl Default for OPEN_DRONE_ID_LOCATION_DATA {
23032 fn default() -> Self {
23033 Self::DEFAULT.clone()
23034 }
23035}
23036impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
23037 type Message = MavMessage;
23038 const ID: u32 = 12901u32;
23039 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
23040 const EXTRA_CRC: u8 = 254u8;
23041 const ENCODED_LEN: usize = 59usize;
23042 fn deser(
23043 _version: MavlinkVersion,
23044 __input: &[u8],
23045 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23046 let avail_len = __input.len();
23047 let mut payload_buf = [0; Self::ENCODED_LEN];
23048 let mut buf = if avail_len < Self::ENCODED_LEN {
23049 payload_buf[0..avail_len].copy_from_slice(__input);
23050 Bytes::new(&payload_buf)
23051 } else {
23052 Bytes::new(__input)
23053 };
23054 let mut __struct = Self::default();
23055 __struct.latitude = buf.get_i32_le();
23056 __struct.longitude = buf.get_i32_le();
23057 __struct.altitude_barometric = buf.get_f32_le();
23058 __struct.altitude_geodetic = buf.get_f32_le();
23059 __struct.height = buf.get_f32_le();
23060 __struct.timestamp = buf.get_f32_le();
23061 __struct.direction = buf.get_u16_le();
23062 __struct.speed_horizontal = buf.get_u16_le();
23063 __struct.speed_vertical = buf.get_i16_le();
23064 __struct.target_system = buf.get_u8();
23065 __struct.target_component = buf.get_u8();
23066 for v in &mut __struct.id_or_mac {
23067 let val = buf.get_u8();
23068 *v = val;
23069 }
23070 let tmp = buf.get_u8();
23071 __struct.status =
23072 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23073 enum_type: "MavOdidStatus",
23074 value: tmp as u32,
23075 })?;
23076 let tmp = buf.get_u8();
23077 __struct.height_reference =
23078 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23079 enum_type: "MavOdidHeightRef",
23080 value: tmp as u32,
23081 })?;
23082 let tmp = buf.get_u8();
23083 __struct.horizontal_accuracy =
23084 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23085 enum_type: "MavOdidHorAcc",
23086 value: tmp as u32,
23087 })?;
23088 let tmp = buf.get_u8();
23089 __struct.vertical_accuracy =
23090 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23091 enum_type: "MavOdidVerAcc",
23092 value: tmp as u32,
23093 })?;
23094 let tmp = buf.get_u8();
23095 __struct.barometer_accuracy =
23096 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23097 enum_type: "MavOdidVerAcc",
23098 value: tmp as u32,
23099 })?;
23100 let tmp = buf.get_u8();
23101 __struct.speed_accuracy =
23102 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23103 enum_type: "MavOdidSpeedAcc",
23104 value: tmp as u32,
23105 })?;
23106 let tmp = buf.get_u8();
23107 __struct.timestamp_accuracy =
23108 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23109 enum_type: "MavOdidTimeAcc",
23110 value: tmp as u32,
23111 })?;
23112 Ok(__struct)
23113 }
23114 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23115 let mut __tmp = BytesMut::new(bytes);
23116 #[allow(clippy::absurd_extreme_comparisons)]
23117 #[allow(unused_comparisons)]
23118 if __tmp.remaining() < Self::ENCODED_LEN {
23119 panic!(
23120 "buffer is too small (need {} bytes, but got {})",
23121 Self::ENCODED_LEN,
23122 __tmp.remaining(),
23123 )
23124 }
23125 __tmp.put_i32_le(self.latitude);
23126 __tmp.put_i32_le(self.longitude);
23127 __tmp.put_f32_le(self.altitude_barometric);
23128 __tmp.put_f32_le(self.altitude_geodetic);
23129 __tmp.put_f32_le(self.height);
23130 __tmp.put_f32_le(self.timestamp);
23131 __tmp.put_u16_le(self.direction);
23132 __tmp.put_u16_le(self.speed_horizontal);
23133 __tmp.put_i16_le(self.speed_vertical);
23134 __tmp.put_u8(self.target_system);
23135 __tmp.put_u8(self.target_component);
23136 for val in &self.id_or_mac {
23137 __tmp.put_u8(*val);
23138 }
23139 __tmp.put_u8(self.status as u8);
23140 __tmp.put_u8(self.height_reference as u8);
23141 __tmp.put_u8(self.horizontal_accuracy as u8);
23142 __tmp.put_u8(self.vertical_accuracy as u8);
23143 __tmp.put_u8(self.barometer_accuracy as u8);
23144 __tmp.put_u8(self.speed_accuracy as u8);
23145 __tmp.put_u8(self.timestamp_accuracy as u8);
23146 if matches!(version, MavlinkVersion::V2) {
23147 let len = __tmp.len();
23148 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23149 } else {
23150 __tmp.len()
23151 }
23152 }
23153}
23154#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
23155#[doc = ""]
23156#[doc = "ID: 12915"]
23157#[derive(Debug, Clone, PartialEq)]
23158#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23159#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23160#[cfg_attr(feature = "ts", derive(TS))]
23161#[cfg_attr(feature = "ts", ts(export))]
23162pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
23163 #[doc = "System ID (0 for broadcast)."]
23164 pub target_system: u8,
23165 #[doc = "Component ID (0 for broadcast)."]
23166 pub target_component: u8,
23167 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23168 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23169 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23170 pub id_or_mac: [u8; 20],
23171 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
23172 pub single_message_size: u8,
23173 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
23174 pub msg_pack_size: u8,
23175 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
23176 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23177 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23178 pub messages: [u8; 225],
23179}
23180impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
23181 pub const ENCODED_LEN: usize = 249usize;
23182 pub const DEFAULT: Self = Self {
23183 target_system: 0_u8,
23184 target_component: 0_u8,
23185 id_or_mac: [0_u8; 20usize],
23186 single_message_size: 0_u8,
23187 msg_pack_size: 0_u8,
23188 messages: [0_u8; 225usize],
23189 };
23190 #[cfg(feature = "arbitrary")]
23191 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23192 use arbitrary::{Arbitrary, Unstructured};
23193 let mut buf = [0u8; 1024];
23194 rng.fill_bytes(&mut buf);
23195 let mut unstructured = Unstructured::new(&buf);
23196 Self::arbitrary(&mut unstructured).unwrap_or_default()
23197 }
23198}
23199impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
23200 fn default() -> Self {
23201 Self::DEFAULT.clone()
23202 }
23203}
23204impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
23205 type Message = MavMessage;
23206 const ID: u32 = 12915u32;
23207 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
23208 const EXTRA_CRC: u8 = 94u8;
23209 const ENCODED_LEN: usize = 249usize;
23210 fn deser(
23211 _version: MavlinkVersion,
23212 __input: &[u8],
23213 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23214 let avail_len = __input.len();
23215 let mut payload_buf = [0; Self::ENCODED_LEN];
23216 let mut buf = if avail_len < Self::ENCODED_LEN {
23217 payload_buf[0..avail_len].copy_from_slice(__input);
23218 Bytes::new(&payload_buf)
23219 } else {
23220 Bytes::new(__input)
23221 };
23222 let mut __struct = Self::default();
23223 __struct.target_system = buf.get_u8();
23224 __struct.target_component = buf.get_u8();
23225 for v in &mut __struct.id_or_mac {
23226 let val = buf.get_u8();
23227 *v = val;
23228 }
23229 __struct.single_message_size = buf.get_u8();
23230 __struct.msg_pack_size = buf.get_u8();
23231 for v in &mut __struct.messages {
23232 let val = buf.get_u8();
23233 *v = val;
23234 }
23235 Ok(__struct)
23236 }
23237 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23238 let mut __tmp = BytesMut::new(bytes);
23239 #[allow(clippy::absurd_extreme_comparisons)]
23240 #[allow(unused_comparisons)]
23241 if __tmp.remaining() < Self::ENCODED_LEN {
23242 panic!(
23243 "buffer is too small (need {} bytes, but got {})",
23244 Self::ENCODED_LEN,
23245 __tmp.remaining(),
23246 )
23247 }
23248 __tmp.put_u8(self.target_system);
23249 __tmp.put_u8(self.target_component);
23250 for val in &self.id_or_mac {
23251 __tmp.put_u8(*val);
23252 }
23253 __tmp.put_u8(self.single_message_size);
23254 __tmp.put_u8(self.msg_pack_size);
23255 for val in &self.messages {
23256 __tmp.put_u8(*val);
23257 }
23258 if matches!(version, MavlinkVersion::V2) {
23259 let len = __tmp.len();
23260 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23261 } else {
23262 __tmp.len()
23263 }
23264 }
23265}
23266#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
23267#[doc = ""]
23268#[doc = "ID: 12905"]
23269#[derive(Debug, Clone, PartialEq)]
23270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23271#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23272#[cfg_attr(feature = "ts", derive(TS))]
23273#[cfg_attr(feature = "ts", ts(export))]
23274pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
23275 #[doc = "System ID (0 for broadcast)."]
23276 pub target_system: u8,
23277 #[doc = "Component ID (0 for broadcast)."]
23278 pub target_component: u8,
23279 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23280 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23281 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23282 pub id_or_mac: [u8; 20],
23283 #[doc = "Indicates the type of the operator_id field."]
23284 pub operator_id_type: MavOdidOperatorIdType,
23285 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
23286 #[cfg_attr(
23287 feature = "serde",
23288 serde(
23289 serialize_with = "crate::nulstr::serialize::<_, 20>",
23290 deserialize_with = "crate::nulstr::deserialize::<_, 20>"
23291 )
23292 )]
23293 #[cfg_attr(feature = "ts", ts(type = "string"))]
23294 pub operator_id: [u8; 20],
23295}
23296impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
23297 pub const ENCODED_LEN: usize = 43usize;
23298 pub const DEFAULT: Self = Self {
23299 target_system: 0_u8,
23300 target_component: 0_u8,
23301 id_or_mac: [0_u8; 20usize],
23302 operator_id_type: MavOdidOperatorIdType::DEFAULT,
23303 operator_id: [0_u8; 20usize],
23304 };
23305 #[cfg(feature = "arbitrary")]
23306 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23307 use arbitrary::{Arbitrary, Unstructured};
23308 let mut buf = [0u8; 1024];
23309 rng.fill_bytes(&mut buf);
23310 let mut unstructured = Unstructured::new(&buf);
23311 Self::arbitrary(&mut unstructured).unwrap_or_default()
23312 }
23313}
23314impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
23315 fn default() -> Self {
23316 Self::DEFAULT.clone()
23317 }
23318}
23319impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
23320 type Message = MavMessage;
23321 const ID: u32 = 12905u32;
23322 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
23323 const EXTRA_CRC: u8 = 49u8;
23324 const ENCODED_LEN: usize = 43usize;
23325 fn deser(
23326 _version: MavlinkVersion,
23327 __input: &[u8],
23328 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23329 let avail_len = __input.len();
23330 let mut payload_buf = [0; Self::ENCODED_LEN];
23331 let mut buf = if avail_len < Self::ENCODED_LEN {
23332 payload_buf[0..avail_len].copy_from_slice(__input);
23333 Bytes::new(&payload_buf)
23334 } else {
23335 Bytes::new(__input)
23336 };
23337 let mut __struct = Self::default();
23338 __struct.target_system = buf.get_u8();
23339 __struct.target_component = buf.get_u8();
23340 for v in &mut __struct.id_or_mac {
23341 let val = buf.get_u8();
23342 *v = val;
23343 }
23344 let tmp = buf.get_u8();
23345 __struct.operator_id_type =
23346 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23347 enum_type: "MavOdidOperatorIdType",
23348 value: tmp as u32,
23349 })?;
23350 for v in &mut __struct.operator_id {
23351 let val = buf.get_u8();
23352 *v = val;
23353 }
23354 Ok(__struct)
23355 }
23356 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23357 let mut __tmp = BytesMut::new(bytes);
23358 #[allow(clippy::absurd_extreme_comparisons)]
23359 #[allow(unused_comparisons)]
23360 if __tmp.remaining() < Self::ENCODED_LEN {
23361 panic!(
23362 "buffer is too small (need {} bytes, but got {})",
23363 Self::ENCODED_LEN,
23364 __tmp.remaining(),
23365 )
23366 }
23367 __tmp.put_u8(self.target_system);
23368 __tmp.put_u8(self.target_component);
23369 for val in &self.id_or_mac {
23370 __tmp.put_u8(*val);
23371 }
23372 __tmp.put_u8(self.operator_id_type as u8);
23373 for val in &self.operator_id {
23374 __tmp.put_u8(*val);
23375 }
23376 if matches!(version, MavlinkVersion::V2) {
23377 let len = __tmp.len();
23378 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23379 } else {
23380 __tmp.len()
23381 }
23382 }
23383}
23384#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
23385#[doc = ""]
23386#[doc = "ID: 12903"]
23387#[derive(Debug, Clone, PartialEq)]
23388#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23389#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23390#[cfg_attr(feature = "ts", derive(TS))]
23391#[cfg_attr(feature = "ts", ts(export))]
23392pub struct OPEN_DRONE_ID_SELF_ID_DATA {
23393 #[doc = "System ID (0 for broadcast)."]
23394 pub target_system: u8,
23395 #[doc = "Component ID (0 for broadcast)."]
23396 pub target_component: u8,
23397 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23398 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23399 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23400 pub id_or_mac: [u8; 20],
23401 #[doc = "Indicates the type of the description field."]
23402 pub description_type: MavOdidDescType,
23403 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
23404 #[cfg_attr(
23405 feature = "serde",
23406 serde(
23407 serialize_with = "crate::nulstr::serialize::<_, 23>",
23408 deserialize_with = "crate::nulstr::deserialize::<_, 23>"
23409 )
23410 )]
23411 #[cfg_attr(feature = "ts", ts(type = "string"))]
23412 pub description: [u8; 23],
23413}
23414impl OPEN_DRONE_ID_SELF_ID_DATA {
23415 pub const ENCODED_LEN: usize = 46usize;
23416 pub const DEFAULT: Self = Self {
23417 target_system: 0_u8,
23418 target_component: 0_u8,
23419 id_or_mac: [0_u8; 20usize],
23420 description_type: MavOdidDescType::DEFAULT,
23421 description: [0_u8; 23usize],
23422 };
23423 #[cfg(feature = "arbitrary")]
23424 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23425 use arbitrary::{Arbitrary, Unstructured};
23426 let mut buf = [0u8; 1024];
23427 rng.fill_bytes(&mut buf);
23428 let mut unstructured = Unstructured::new(&buf);
23429 Self::arbitrary(&mut unstructured).unwrap_or_default()
23430 }
23431}
23432impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
23433 fn default() -> Self {
23434 Self::DEFAULT.clone()
23435 }
23436}
23437impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
23438 type Message = MavMessage;
23439 const ID: u32 = 12903u32;
23440 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
23441 const EXTRA_CRC: u8 = 249u8;
23442 const ENCODED_LEN: usize = 46usize;
23443 fn deser(
23444 _version: MavlinkVersion,
23445 __input: &[u8],
23446 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23447 let avail_len = __input.len();
23448 let mut payload_buf = [0; Self::ENCODED_LEN];
23449 let mut buf = if avail_len < Self::ENCODED_LEN {
23450 payload_buf[0..avail_len].copy_from_slice(__input);
23451 Bytes::new(&payload_buf)
23452 } else {
23453 Bytes::new(__input)
23454 };
23455 let mut __struct = Self::default();
23456 __struct.target_system = buf.get_u8();
23457 __struct.target_component = buf.get_u8();
23458 for v in &mut __struct.id_or_mac {
23459 let val = buf.get_u8();
23460 *v = val;
23461 }
23462 let tmp = buf.get_u8();
23463 __struct.description_type =
23464 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23465 enum_type: "MavOdidDescType",
23466 value: tmp as u32,
23467 })?;
23468 for v in &mut __struct.description {
23469 let val = buf.get_u8();
23470 *v = val;
23471 }
23472 Ok(__struct)
23473 }
23474 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23475 let mut __tmp = BytesMut::new(bytes);
23476 #[allow(clippy::absurd_extreme_comparisons)]
23477 #[allow(unused_comparisons)]
23478 if __tmp.remaining() < Self::ENCODED_LEN {
23479 panic!(
23480 "buffer is too small (need {} bytes, but got {})",
23481 Self::ENCODED_LEN,
23482 __tmp.remaining(),
23483 )
23484 }
23485 __tmp.put_u8(self.target_system);
23486 __tmp.put_u8(self.target_component);
23487 for val in &self.id_or_mac {
23488 __tmp.put_u8(*val);
23489 }
23490 __tmp.put_u8(self.description_type as u8);
23491 for val in &self.description {
23492 __tmp.put_u8(*val);
23493 }
23494 if matches!(version, MavlinkVersion::V2) {
23495 let len = __tmp.len();
23496 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23497 } else {
23498 __tmp.len()
23499 }
23500 }
23501}
23502#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
23503#[doc = ""]
23504#[doc = "ID: 12904"]
23505#[derive(Debug, Clone, PartialEq)]
23506#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23507#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23508#[cfg_attr(feature = "ts", derive(TS))]
23509#[cfg_attr(feature = "ts", ts(export))]
23510pub struct OPEN_DRONE_ID_SYSTEM_DATA {
23511 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
23512 pub operator_latitude: i32,
23513 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
23514 pub operator_longitude: i32,
23515 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
23516 pub area_ceiling: f32,
23517 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
23518 pub area_floor: f32,
23519 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
23520 pub operator_altitude_geo: f32,
23521 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
23522 pub timestamp: u32,
23523 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
23524 pub area_count: u16,
23525 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
23526 pub area_radius: u16,
23527 #[doc = "System ID (0 for broadcast)."]
23528 pub target_system: u8,
23529 #[doc = "Component ID (0 for broadcast)."]
23530 pub target_component: u8,
23531 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23532 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23533 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23534 pub id_or_mac: [u8; 20],
23535 #[doc = "Specifies the operator location type."]
23536 pub operator_location_type: MavOdidOperatorLocationType,
23537 #[doc = "Specifies the classification type of the UA."]
23538 pub classification_type: MavOdidClassificationType,
23539 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
23540 pub category_eu: MavOdidCategoryEu,
23541 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
23542 pub class_eu: MavOdidClassEu,
23543}
23544impl OPEN_DRONE_ID_SYSTEM_DATA {
23545 pub const ENCODED_LEN: usize = 54usize;
23546 pub const DEFAULT: Self = Self {
23547 operator_latitude: 0_i32,
23548 operator_longitude: 0_i32,
23549 area_ceiling: 0.0_f32,
23550 area_floor: 0.0_f32,
23551 operator_altitude_geo: 0.0_f32,
23552 timestamp: 0_u32,
23553 area_count: 0_u16,
23554 area_radius: 0_u16,
23555 target_system: 0_u8,
23556 target_component: 0_u8,
23557 id_or_mac: [0_u8; 20usize],
23558 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
23559 classification_type: MavOdidClassificationType::DEFAULT,
23560 category_eu: MavOdidCategoryEu::DEFAULT,
23561 class_eu: MavOdidClassEu::DEFAULT,
23562 };
23563 #[cfg(feature = "arbitrary")]
23564 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23565 use arbitrary::{Arbitrary, Unstructured};
23566 let mut buf = [0u8; 1024];
23567 rng.fill_bytes(&mut buf);
23568 let mut unstructured = Unstructured::new(&buf);
23569 Self::arbitrary(&mut unstructured).unwrap_or_default()
23570 }
23571}
23572impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
23573 fn default() -> Self {
23574 Self::DEFAULT.clone()
23575 }
23576}
23577impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
23578 type Message = MavMessage;
23579 const ID: u32 = 12904u32;
23580 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
23581 const EXTRA_CRC: u8 = 77u8;
23582 const ENCODED_LEN: usize = 54usize;
23583 fn deser(
23584 _version: MavlinkVersion,
23585 __input: &[u8],
23586 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23587 let avail_len = __input.len();
23588 let mut payload_buf = [0; Self::ENCODED_LEN];
23589 let mut buf = if avail_len < Self::ENCODED_LEN {
23590 payload_buf[0..avail_len].copy_from_slice(__input);
23591 Bytes::new(&payload_buf)
23592 } else {
23593 Bytes::new(__input)
23594 };
23595 let mut __struct = Self::default();
23596 __struct.operator_latitude = buf.get_i32_le();
23597 __struct.operator_longitude = buf.get_i32_le();
23598 __struct.area_ceiling = buf.get_f32_le();
23599 __struct.area_floor = buf.get_f32_le();
23600 __struct.operator_altitude_geo = buf.get_f32_le();
23601 __struct.timestamp = buf.get_u32_le();
23602 __struct.area_count = buf.get_u16_le();
23603 __struct.area_radius = buf.get_u16_le();
23604 __struct.target_system = buf.get_u8();
23605 __struct.target_component = buf.get_u8();
23606 for v in &mut __struct.id_or_mac {
23607 let val = buf.get_u8();
23608 *v = val;
23609 }
23610 let tmp = buf.get_u8();
23611 __struct.operator_location_type =
23612 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23613 enum_type: "MavOdidOperatorLocationType",
23614 value: tmp as u32,
23615 })?;
23616 let tmp = buf.get_u8();
23617 __struct.classification_type =
23618 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23619 enum_type: "MavOdidClassificationType",
23620 value: tmp as u32,
23621 })?;
23622 let tmp = buf.get_u8();
23623 __struct.category_eu =
23624 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23625 enum_type: "MavOdidCategoryEu",
23626 value: tmp as u32,
23627 })?;
23628 let tmp = buf.get_u8();
23629 __struct.class_eu =
23630 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23631 enum_type: "MavOdidClassEu",
23632 value: tmp as u32,
23633 })?;
23634 Ok(__struct)
23635 }
23636 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23637 let mut __tmp = BytesMut::new(bytes);
23638 #[allow(clippy::absurd_extreme_comparisons)]
23639 #[allow(unused_comparisons)]
23640 if __tmp.remaining() < Self::ENCODED_LEN {
23641 panic!(
23642 "buffer is too small (need {} bytes, but got {})",
23643 Self::ENCODED_LEN,
23644 __tmp.remaining(),
23645 )
23646 }
23647 __tmp.put_i32_le(self.operator_latitude);
23648 __tmp.put_i32_le(self.operator_longitude);
23649 __tmp.put_f32_le(self.area_ceiling);
23650 __tmp.put_f32_le(self.area_floor);
23651 __tmp.put_f32_le(self.operator_altitude_geo);
23652 __tmp.put_u32_le(self.timestamp);
23653 __tmp.put_u16_le(self.area_count);
23654 __tmp.put_u16_le(self.area_radius);
23655 __tmp.put_u8(self.target_system);
23656 __tmp.put_u8(self.target_component);
23657 for val in &self.id_or_mac {
23658 __tmp.put_u8(*val);
23659 }
23660 __tmp.put_u8(self.operator_location_type as u8);
23661 __tmp.put_u8(self.classification_type as u8);
23662 __tmp.put_u8(self.category_eu as u8);
23663 __tmp.put_u8(self.class_eu as u8);
23664 if matches!(version, MavlinkVersion::V2) {
23665 let len = __tmp.len();
23666 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23667 } else {
23668 __tmp.len()
23669 }
23670 }
23671}
23672#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
23673#[doc = ""]
23674#[doc = "ID: 12919"]
23675#[derive(Debug, Clone, PartialEq)]
23676#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23677#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23678#[cfg_attr(feature = "ts", derive(TS))]
23679#[cfg_attr(feature = "ts", ts(export))]
23680pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23681 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
23682 pub operator_latitude: i32,
23683 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
23684 pub operator_longitude: i32,
23685 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
23686 pub operator_altitude_geo: f32,
23687 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
23688 pub timestamp: u32,
23689 #[doc = "System ID (0 for broadcast)."]
23690 pub target_system: u8,
23691 #[doc = "Component ID (0 for broadcast)."]
23692 pub target_component: u8,
23693}
23694impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23695 pub const ENCODED_LEN: usize = 18usize;
23696 pub const DEFAULT: Self = Self {
23697 operator_latitude: 0_i32,
23698 operator_longitude: 0_i32,
23699 operator_altitude_geo: 0.0_f32,
23700 timestamp: 0_u32,
23701 target_system: 0_u8,
23702 target_component: 0_u8,
23703 };
23704 #[cfg(feature = "arbitrary")]
23705 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23706 use arbitrary::{Arbitrary, Unstructured};
23707 let mut buf = [0u8; 1024];
23708 rng.fill_bytes(&mut buf);
23709 let mut unstructured = Unstructured::new(&buf);
23710 Self::arbitrary(&mut unstructured).unwrap_or_default()
23711 }
23712}
23713impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23714 fn default() -> Self {
23715 Self::DEFAULT.clone()
23716 }
23717}
23718impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23719 type Message = MavMessage;
23720 const ID: u32 = 12919u32;
23721 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
23722 const EXTRA_CRC: u8 = 7u8;
23723 const ENCODED_LEN: usize = 18usize;
23724 fn deser(
23725 _version: MavlinkVersion,
23726 __input: &[u8],
23727 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23728 let avail_len = __input.len();
23729 let mut payload_buf = [0; Self::ENCODED_LEN];
23730 let mut buf = if avail_len < Self::ENCODED_LEN {
23731 payload_buf[0..avail_len].copy_from_slice(__input);
23732 Bytes::new(&payload_buf)
23733 } else {
23734 Bytes::new(__input)
23735 };
23736 let mut __struct = Self::default();
23737 __struct.operator_latitude = buf.get_i32_le();
23738 __struct.operator_longitude = buf.get_i32_le();
23739 __struct.operator_altitude_geo = buf.get_f32_le();
23740 __struct.timestamp = buf.get_u32_le();
23741 __struct.target_system = buf.get_u8();
23742 __struct.target_component = buf.get_u8();
23743 Ok(__struct)
23744 }
23745 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23746 let mut __tmp = BytesMut::new(bytes);
23747 #[allow(clippy::absurd_extreme_comparisons)]
23748 #[allow(unused_comparisons)]
23749 if __tmp.remaining() < Self::ENCODED_LEN {
23750 panic!(
23751 "buffer is too small (need {} bytes, but got {})",
23752 Self::ENCODED_LEN,
23753 __tmp.remaining(),
23754 )
23755 }
23756 __tmp.put_i32_le(self.operator_latitude);
23757 __tmp.put_i32_le(self.operator_longitude);
23758 __tmp.put_f32_le(self.operator_altitude_geo);
23759 __tmp.put_u32_le(self.timestamp);
23760 __tmp.put_u8(self.target_system);
23761 __tmp.put_u8(self.target_component);
23762 if matches!(version, MavlinkVersion::V2) {
23763 let len = __tmp.len();
23764 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23765 } else {
23766 __tmp.len()
23767 }
23768 }
23769}
23770#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
23771#[doc = ""]
23772#[doc = "ID: 100"]
23773#[derive(Debug, Clone, PartialEq)]
23774#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23775#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23776#[cfg_attr(feature = "ts", derive(TS))]
23777#[cfg_attr(feature = "ts", ts(export))]
23778pub struct OPTICAL_FLOW_DATA {
23779 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23780 pub time_usec: u64,
23781 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
23782 pub flow_comp_m_x: f32,
23783 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
23784 pub flow_comp_m_y: f32,
23785 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
23786 pub ground_distance: f32,
23787 #[doc = "Flow in x-sensor direction"]
23788 pub flow_x: i16,
23789 #[doc = "Flow in y-sensor direction"]
23790 pub flow_y: i16,
23791 #[doc = "Sensor ID"]
23792 pub sensor_id: u8,
23793 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
23794 pub quality: u8,
23795 #[doc = "Flow rate about X axis"]
23796 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23797 pub flow_rate_x: f32,
23798 #[doc = "Flow rate about Y axis"]
23799 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23800 pub flow_rate_y: f32,
23801}
23802impl OPTICAL_FLOW_DATA {
23803 pub const ENCODED_LEN: usize = 34usize;
23804 pub const DEFAULT: Self = Self {
23805 time_usec: 0_u64,
23806 flow_comp_m_x: 0.0_f32,
23807 flow_comp_m_y: 0.0_f32,
23808 ground_distance: 0.0_f32,
23809 flow_x: 0_i16,
23810 flow_y: 0_i16,
23811 sensor_id: 0_u8,
23812 quality: 0_u8,
23813 flow_rate_x: 0.0_f32,
23814 flow_rate_y: 0.0_f32,
23815 };
23816 #[cfg(feature = "arbitrary")]
23817 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23818 use arbitrary::{Arbitrary, Unstructured};
23819 let mut buf = [0u8; 1024];
23820 rng.fill_bytes(&mut buf);
23821 let mut unstructured = Unstructured::new(&buf);
23822 Self::arbitrary(&mut unstructured).unwrap_or_default()
23823 }
23824}
23825impl Default for OPTICAL_FLOW_DATA {
23826 fn default() -> Self {
23827 Self::DEFAULT.clone()
23828 }
23829}
23830impl MessageData for OPTICAL_FLOW_DATA {
23831 type Message = MavMessage;
23832 const ID: u32 = 100u32;
23833 const NAME: &'static str = "OPTICAL_FLOW";
23834 const EXTRA_CRC: u8 = 175u8;
23835 const ENCODED_LEN: usize = 34usize;
23836 fn deser(
23837 _version: MavlinkVersion,
23838 __input: &[u8],
23839 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23840 let avail_len = __input.len();
23841 let mut payload_buf = [0; Self::ENCODED_LEN];
23842 let mut buf = if avail_len < Self::ENCODED_LEN {
23843 payload_buf[0..avail_len].copy_from_slice(__input);
23844 Bytes::new(&payload_buf)
23845 } else {
23846 Bytes::new(__input)
23847 };
23848 let mut __struct = Self::default();
23849 __struct.time_usec = buf.get_u64_le();
23850 __struct.flow_comp_m_x = buf.get_f32_le();
23851 __struct.flow_comp_m_y = buf.get_f32_le();
23852 __struct.ground_distance = buf.get_f32_le();
23853 __struct.flow_x = buf.get_i16_le();
23854 __struct.flow_y = buf.get_i16_le();
23855 __struct.sensor_id = buf.get_u8();
23856 __struct.quality = buf.get_u8();
23857 __struct.flow_rate_x = buf.get_f32_le();
23858 __struct.flow_rate_y = buf.get_f32_le();
23859 Ok(__struct)
23860 }
23861 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23862 let mut __tmp = BytesMut::new(bytes);
23863 #[allow(clippy::absurd_extreme_comparisons)]
23864 #[allow(unused_comparisons)]
23865 if __tmp.remaining() < Self::ENCODED_LEN {
23866 panic!(
23867 "buffer is too small (need {} bytes, but got {})",
23868 Self::ENCODED_LEN,
23869 __tmp.remaining(),
23870 )
23871 }
23872 __tmp.put_u64_le(self.time_usec);
23873 __tmp.put_f32_le(self.flow_comp_m_x);
23874 __tmp.put_f32_le(self.flow_comp_m_y);
23875 __tmp.put_f32_le(self.ground_distance);
23876 __tmp.put_i16_le(self.flow_x);
23877 __tmp.put_i16_le(self.flow_y);
23878 __tmp.put_u8(self.sensor_id);
23879 __tmp.put_u8(self.quality);
23880 if matches!(version, MavlinkVersion::V2) {
23881 __tmp.put_f32_le(self.flow_rate_x);
23882 __tmp.put_f32_le(self.flow_rate_y);
23883 let len = __tmp.len();
23884 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23885 } else {
23886 __tmp.len()
23887 }
23888 }
23889}
23890#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
23891#[doc = ""]
23892#[doc = "ID: 106"]
23893#[derive(Debug, Clone, PartialEq)]
23894#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23895#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23896#[cfg_attr(feature = "ts", derive(TS))]
23897#[cfg_attr(feature = "ts", ts(export))]
23898pub struct OPTICAL_FLOW_RAD_DATA {
23899 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23900 pub time_usec: u64,
23901 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
23902 pub integration_time_us: u32,
23903 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
23904 pub integrated_x: f32,
23905 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
23906 pub integrated_y: f32,
23907 #[doc = "RH rotation around X axis"]
23908 pub integrated_xgyro: f32,
23909 #[doc = "RH rotation around Y axis"]
23910 pub integrated_ygyro: f32,
23911 #[doc = "RH rotation around Z axis"]
23912 pub integrated_zgyro: f32,
23913 #[doc = "Time since the distance was sampled."]
23914 pub time_delta_distance_us: u32,
23915 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
23916 pub distance: f32,
23917 #[doc = "Temperature"]
23918 pub temperature: i16,
23919 #[doc = "Sensor ID"]
23920 pub sensor_id: u8,
23921 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
23922 pub quality: u8,
23923}
23924impl OPTICAL_FLOW_RAD_DATA {
23925 pub const ENCODED_LEN: usize = 44usize;
23926 pub const DEFAULT: Self = Self {
23927 time_usec: 0_u64,
23928 integration_time_us: 0_u32,
23929 integrated_x: 0.0_f32,
23930 integrated_y: 0.0_f32,
23931 integrated_xgyro: 0.0_f32,
23932 integrated_ygyro: 0.0_f32,
23933 integrated_zgyro: 0.0_f32,
23934 time_delta_distance_us: 0_u32,
23935 distance: 0.0_f32,
23936 temperature: 0_i16,
23937 sensor_id: 0_u8,
23938 quality: 0_u8,
23939 };
23940 #[cfg(feature = "arbitrary")]
23941 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23942 use arbitrary::{Arbitrary, Unstructured};
23943 let mut buf = [0u8; 1024];
23944 rng.fill_bytes(&mut buf);
23945 let mut unstructured = Unstructured::new(&buf);
23946 Self::arbitrary(&mut unstructured).unwrap_or_default()
23947 }
23948}
23949impl Default for OPTICAL_FLOW_RAD_DATA {
23950 fn default() -> Self {
23951 Self::DEFAULT.clone()
23952 }
23953}
23954impl MessageData for OPTICAL_FLOW_RAD_DATA {
23955 type Message = MavMessage;
23956 const ID: u32 = 106u32;
23957 const NAME: &'static str = "OPTICAL_FLOW_RAD";
23958 const EXTRA_CRC: u8 = 138u8;
23959 const ENCODED_LEN: usize = 44usize;
23960 fn deser(
23961 _version: MavlinkVersion,
23962 __input: &[u8],
23963 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23964 let avail_len = __input.len();
23965 let mut payload_buf = [0; Self::ENCODED_LEN];
23966 let mut buf = if avail_len < Self::ENCODED_LEN {
23967 payload_buf[0..avail_len].copy_from_slice(__input);
23968 Bytes::new(&payload_buf)
23969 } else {
23970 Bytes::new(__input)
23971 };
23972 let mut __struct = Self::default();
23973 __struct.time_usec = buf.get_u64_le();
23974 __struct.integration_time_us = buf.get_u32_le();
23975 __struct.integrated_x = buf.get_f32_le();
23976 __struct.integrated_y = buf.get_f32_le();
23977 __struct.integrated_xgyro = buf.get_f32_le();
23978 __struct.integrated_ygyro = buf.get_f32_le();
23979 __struct.integrated_zgyro = buf.get_f32_le();
23980 __struct.time_delta_distance_us = buf.get_u32_le();
23981 __struct.distance = buf.get_f32_le();
23982 __struct.temperature = buf.get_i16_le();
23983 __struct.sensor_id = buf.get_u8();
23984 __struct.quality = buf.get_u8();
23985 Ok(__struct)
23986 }
23987 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23988 let mut __tmp = BytesMut::new(bytes);
23989 #[allow(clippy::absurd_extreme_comparisons)]
23990 #[allow(unused_comparisons)]
23991 if __tmp.remaining() < Self::ENCODED_LEN {
23992 panic!(
23993 "buffer is too small (need {} bytes, but got {})",
23994 Self::ENCODED_LEN,
23995 __tmp.remaining(),
23996 )
23997 }
23998 __tmp.put_u64_le(self.time_usec);
23999 __tmp.put_u32_le(self.integration_time_us);
24000 __tmp.put_f32_le(self.integrated_x);
24001 __tmp.put_f32_le(self.integrated_y);
24002 __tmp.put_f32_le(self.integrated_xgyro);
24003 __tmp.put_f32_le(self.integrated_ygyro);
24004 __tmp.put_f32_le(self.integrated_zgyro);
24005 __tmp.put_u32_le(self.time_delta_distance_us);
24006 __tmp.put_f32_le(self.distance);
24007 __tmp.put_i16_le(self.temperature);
24008 __tmp.put_u8(self.sensor_id);
24009 __tmp.put_u8(self.quality);
24010 if matches!(version, MavlinkVersion::V2) {
24011 let len = __tmp.len();
24012 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24013 } else {
24014 __tmp.len()
24015 }
24016 }
24017}
24018#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
24019#[doc = ""]
24020#[doc = "ID: 360"]
24021#[derive(Debug, Clone, PartialEq)]
24022#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24023#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24024#[cfg_attr(feature = "ts", derive(TS))]
24025#[cfg_attr(feature = "ts", ts(export))]
24026pub struct ORBIT_EXECUTION_STATUS_DATA {
24027 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24028 pub time_usec: u64,
24029 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
24030 pub radius: f32,
24031 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
24032 pub x: i32,
24033 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
24034 pub y: i32,
24035 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
24036 pub z: f32,
24037 #[doc = "The coordinate system of the fields: x, y, z."]
24038 pub frame: MavFrame,
24039}
24040impl ORBIT_EXECUTION_STATUS_DATA {
24041 pub const ENCODED_LEN: usize = 25usize;
24042 pub const DEFAULT: Self = Self {
24043 time_usec: 0_u64,
24044 radius: 0.0_f32,
24045 x: 0_i32,
24046 y: 0_i32,
24047 z: 0.0_f32,
24048 frame: MavFrame::DEFAULT,
24049 };
24050 #[cfg(feature = "arbitrary")]
24051 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24052 use arbitrary::{Arbitrary, Unstructured};
24053 let mut buf = [0u8; 1024];
24054 rng.fill_bytes(&mut buf);
24055 let mut unstructured = Unstructured::new(&buf);
24056 Self::arbitrary(&mut unstructured).unwrap_or_default()
24057 }
24058}
24059impl Default for ORBIT_EXECUTION_STATUS_DATA {
24060 fn default() -> Self {
24061 Self::DEFAULT.clone()
24062 }
24063}
24064impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
24065 type Message = MavMessage;
24066 const ID: u32 = 360u32;
24067 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
24068 const EXTRA_CRC: u8 = 11u8;
24069 const ENCODED_LEN: usize = 25usize;
24070 fn deser(
24071 _version: MavlinkVersion,
24072 __input: &[u8],
24073 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24074 let avail_len = __input.len();
24075 let mut payload_buf = [0; Self::ENCODED_LEN];
24076 let mut buf = if avail_len < Self::ENCODED_LEN {
24077 payload_buf[0..avail_len].copy_from_slice(__input);
24078 Bytes::new(&payload_buf)
24079 } else {
24080 Bytes::new(__input)
24081 };
24082 let mut __struct = Self::default();
24083 __struct.time_usec = buf.get_u64_le();
24084 __struct.radius = buf.get_f32_le();
24085 __struct.x = buf.get_i32_le();
24086 __struct.y = buf.get_i32_le();
24087 __struct.z = buf.get_f32_le();
24088 let tmp = buf.get_u8();
24089 __struct.frame =
24090 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24091 enum_type: "MavFrame",
24092 value: tmp as u32,
24093 })?;
24094 Ok(__struct)
24095 }
24096 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24097 let mut __tmp = BytesMut::new(bytes);
24098 #[allow(clippy::absurd_extreme_comparisons)]
24099 #[allow(unused_comparisons)]
24100 if __tmp.remaining() < Self::ENCODED_LEN {
24101 panic!(
24102 "buffer is too small (need {} bytes, but got {})",
24103 Self::ENCODED_LEN,
24104 __tmp.remaining(),
24105 )
24106 }
24107 __tmp.put_u64_le(self.time_usec);
24108 __tmp.put_f32_le(self.radius);
24109 __tmp.put_i32_le(self.x);
24110 __tmp.put_i32_le(self.y);
24111 __tmp.put_f32_le(self.z);
24112 __tmp.put_u8(self.frame as u8);
24113 if matches!(version, MavlinkVersion::V2) {
24114 let len = __tmp.len();
24115 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24116 } else {
24117 __tmp.len()
24118 }
24119 }
24120}
24121#[doc = "Response from a PARAM_EXT_SET message."]
24122#[doc = ""]
24123#[doc = "ID: 324"]
24124#[derive(Debug, Clone, PartialEq)]
24125#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24126#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24127#[cfg_attr(feature = "ts", derive(TS))]
24128#[cfg_attr(feature = "ts", ts(export))]
24129pub struct PARAM_EXT_ACK_DATA {
24130 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24131 #[cfg_attr(
24132 feature = "serde",
24133 serde(
24134 serialize_with = "crate::nulstr::serialize::<_, 16>",
24135 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24136 )
24137 )]
24138 #[cfg_attr(feature = "ts", ts(type = "string"))]
24139 pub param_id: [u8; 16],
24140 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
24141 #[cfg_attr(
24142 feature = "serde",
24143 serde(
24144 serialize_with = "crate::nulstr::serialize::<_, 128>",
24145 deserialize_with = "crate::nulstr::deserialize::<_, 128>"
24146 )
24147 )]
24148 #[cfg_attr(feature = "ts", ts(type = "string"))]
24149 pub param_value: [u8; 128],
24150 #[doc = "Parameter type."]
24151 pub param_type: MavParamExtType,
24152 #[doc = "Result code."]
24153 pub param_result: ParamAck,
24154}
24155impl PARAM_EXT_ACK_DATA {
24156 pub const ENCODED_LEN: usize = 146usize;
24157 pub const DEFAULT: Self = Self {
24158 param_id: [0_u8; 16usize],
24159 param_value: [0_u8; 128usize],
24160 param_type: MavParamExtType::DEFAULT,
24161 param_result: ParamAck::DEFAULT,
24162 };
24163 #[cfg(feature = "arbitrary")]
24164 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24165 use arbitrary::{Arbitrary, Unstructured};
24166 let mut buf = [0u8; 1024];
24167 rng.fill_bytes(&mut buf);
24168 let mut unstructured = Unstructured::new(&buf);
24169 Self::arbitrary(&mut unstructured).unwrap_or_default()
24170 }
24171}
24172impl Default for PARAM_EXT_ACK_DATA {
24173 fn default() -> Self {
24174 Self::DEFAULT.clone()
24175 }
24176}
24177impl MessageData for PARAM_EXT_ACK_DATA {
24178 type Message = MavMessage;
24179 const ID: u32 = 324u32;
24180 const NAME: &'static str = "PARAM_EXT_ACK";
24181 const EXTRA_CRC: u8 = 132u8;
24182 const ENCODED_LEN: usize = 146usize;
24183 fn deser(
24184 _version: MavlinkVersion,
24185 __input: &[u8],
24186 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24187 let avail_len = __input.len();
24188 let mut payload_buf = [0; Self::ENCODED_LEN];
24189 let mut buf = if avail_len < Self::ENCODED_LEN {
24190 payload_buf[0..avail_len].copy_from_slice(__input);
24191 Bytes::new(&payload_buf)
24192 } else {
24193 Bytes::new(__input)
24194 };
24195 let mut __struct = Self::default();
24196 for v in &mut __struct.param_id {
24197 let val = buf.get_u8();
24198 *v = val;
24199 }
24200 for v in &mut __struct.param_value {
24201 let val = buf.get_u8();
24202 *v = val;
24203 }
24204 let tmp = buf.get_u8();
24205 __struct.param_type =
24206 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24207 enum_type: "MavParamExtType",
24208 value: tmp as u32,
24209 })?;
24210 let tmp = buf.get_u8();
24211 __struct.param_result =
24212 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24213 enum_type: "ParamAck",
24214 value: tmp as u32,
24215 })?;
24216 Ok(__struct)
24217 }
24218 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24219 let mut __tmp = BytesMut::new(bytes);
24220 #[allow(clippy::absurd_extreme_comparisons)]
24221 #[allow(unused_comparisons)]
24222 if __tmp.remaining() < Self::ENCODED_LEN {
24223 panic!(
24224 "buffer is too small (need {} bytes, but got {})",
24225 Self::ENCODED_LEN,
24226 __tmp.remaining(),
24227 )
24228 }
24229 for val in &self.param_id {
24230 __tmp.put_u8(*val);
24231 }
24232 for val in &self.param_value {
24233 __tmp.put_u8(*val);
24234 }
24235 __tmp.put_u8(self.param_type as u8);
24236 __tmp.put_u8(self.param_result as u8);
24237 if matches!(version, MavlinkVersion::V2) {
24238 let len = __tmp.len();
24239 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24240 } else {
24241 __tmp.len()
24242 }
24243 }
24244}
24245#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
24246#[doc = ""]
24247#[doc = "ID: 321"]
24248#[derive(Debug, Clone, PartialEq)]
24249#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24250#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24251#[cfg_attr(feature = "ts", derive(TS))]
24252#[cfg_attr(feature = "ts", ts(export))]
24253pub struct PARAM_EXT_REQUEST_LIST_DATA {
24254 #[doc = "System ID"]
24255 pub target_system: u8,
24256 #[doc = "Component ID"]
24257 pub target_component: u8,
24258}
24259impl PARAM_EXT_REQUEST_LIST_DATA {
24260 pub const ENCODED_LEN: usize = 2usize;
24261 pub const DEFAULT: Self = Self {
24262 target_system: 0_u8,
24263 target_component: 0_u8,
24264 };
24265 #[cfg(feature = "arbitrary")]
24266 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24267 use arbitrary::{Arbitrary, Unstructured};
24268 let mut buf = [0u8; 1024];
24269 rng.fill_bytes(&mut buf);
24270 let mut unstructured = Unstructured::new(&buf);
24271 Self::arbitrary(&mut unstructured).unwrap_or_default()
24272 }
24273}
24274impl Default for PARAM_EXT_REQUEST_LIST_DATA {
24275 fn default() -> Self {
24276 Self::DEFAULT.clone()
24277 }
24278}
24279impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
24280 type Message = MavMessage;
24281 const ID: u32 = 321u32;
24282 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
24283 const EXTRA_CRC: u8 = 88u8;
24284 const ENCODED_LEN: usize = 2usize;
24285 fn deser(
24286 _version: MavlinkVersion,
24287 __input: &[u8],
24288 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24289 let avail_len = __input.len();
24290 let mut payload_buf = [0; Self::ENCODED_LEN];
24291 let mut buf = if avail_len < Self::ENCODED_LEN {
24292 payload_buf[0..avail_len].copy_from_slice(__input);
24293 Bytes::new(&payload_buf)
24294 } else {
24295 Bytes::new(__input)
24296 };
24297 let mut __struct = Self::default();
24298 __struct.target_system = buf.get_u8();
24299 __struct.target_component = buf.get_u8();
24300 Ok(__struct)
24301 }
24302 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24303 let mut __tmp = BytesMut::new(bytes);
24304 #[allow(clippy::absurd_extreme_comparisons)]
24305 #[allow(unused_comparisons)]
24306 if __tmp.remaining() < Self::ENCODED_LEN {
24307 panic!(
24308 "buffer is too small (need {} bytes, but got {})",
24309 Self::ENCODED_LEN,
24310 __tmp.remaining(),
24311 )
24312 }
24313 __tmp.put_u8(self.target_system);
24314 __tmp.put_u8(self.target_component);
24315 if matches!(version, MavlinkVersion::V2) {
24316 let len = __tmp.len();
24317 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24318 } else {
24319 __tmp.len()
24320 }
24321 }
24322}
24323#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
24324#[doc = ""]
24325#[doc = "ID: 320"]
24326#[derive(Debug, Clone, PartialEq)]
24327#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24328#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24329#[cfg_attr(feature = "ts", derive(TS))]
24330#[cfg_attr(feature = "ts", ts(export))]
24331pub struct PARAM_EXT_REQUEST_READ_DATA {
24332 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
24333 pub param_index: i16,
24334 #[doc = "System ID"]
24335 pub target_system: u8,
24336 #[doc = "Component ID"]
24337 pub target_component: u8,
24338 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24339 #[cfg_attr(
24340 feature = "serde",
24341 serde(
24342 serialize_with = "crate::nulstr::serialize::<_, 16>",
24343 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24344 )
24345 )]
24346 #[cfg_attr(feature = "ts", ts(type = "string"))]
24347 pub param_id: [u8; 16],
24348}
24349impl PARAM_EXT_REQUEST_READ_DATA {
24350 pub const ENCODED_LEN: usize = 20usize;
24351 pub const DEFAULT: Self = Self {
24352 param_index: 0_i16,
24353 target_system: 0_u8,
24354 target_component: 0_u8,
24355 param_id: [0_u8; 16usize],
24356 };
24357 #[cfg(feature = "arbitrary")]
24358 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24359 use arbitrary::{Arbitrary, Unstructured};
24360 let mut buf = [0u8; 1024];
24361 rng.fill_bytes(&mut buf);
24362 let mut unstructured = Unstructured::new(&buf);
24363 Self::arbitrary(&mut unstructured).unwrap_or_default()
24364 }
24365}
24366impl Default for PARAM_EXT_REQUEST_READ_DATA {
24367 fn default() -> Self {
24368 Self::DEFAULT.clone()
24369 }
24370}
24371impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
24372 type Message = MavMessage;
24373 const ID: u32 = 320u32;
24374 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
24375 const EXTRA_CRC: u8 = 243u8;
24376 const ENCODED_LEN: usize = 20usize;
24377 fn deser(
24378 _version: MavlinkVersion,
24379 __input: &[u8],
24380 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24381 let avail_len = __input.len();
24382 let mut payload_buf = [0; Self::ENCODED_LEN];
24383 let mut buf = if avail_len < Self::ENCODED_LEN {
24384 payload_buf[0..avail_len].copy_from_slice(__input);
24385 Bytes::new(&payload_buf)
24386 } else {
24387 Bytes::new(__input)
24388 };
24389 let mut __struct = Self::default();
24390 __struct.param_index = buf.get_i16_le();
24391 __struct.target_system = buf.get_u8();
24392 __struct.target_component = buf.get_u8();
24393 for v in &mut __struct.param_id {
24394 let val = buf.get_u8();
24395 *v = val;
24396 }
24397 Ok(__struct)
24398 }
24399 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24400 let mut __tmp = BytesMut::new(bytes);
24401 #[allow(clippy::absurd_extreme_comparisons)]
24402 #[allow(unused_comparisons)]
24403 if __tmp.remaining() < Self::ENCODED_LEN {
24404 panic!(
24405 "buffer is too small (need {} bytes, but got {})",
24406 Self::ENCODED_LEN,
24407 __tmp.remaining(),
24408 )
24409 }
24410 __tmp.put_i16_le(self.param_index);
24411 __tmp.put_u8(self.target_system);
24412 __tmp.put_u8(self.target_component);
24413 for val in &self.param_id {
24414 __tmp.put_u8(*val);
24415 }
24416 if matches!(version, MavlinkVersion::V2) {
24417 let len = __tmp.len();
24418 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24419 } else {
24420 __tmp.len()
24421 }
24422 }
24423}
24424#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
24425#[doc = ""]
24426#[doc = "ID: 323"]
24427#[derive(Debug, Clone, PartialEq)]
24428#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24429#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24430#[cfg_attr(feature = "ts", derive(TS))]
24431#[cfg_attr(feature = "ts", ts(export))]
24432pub struct PARAM_EXT_SET_DATA {
24433 #[doc = "System ID"]
24434 pub target_system: u8,
24435 #[doc = "Component ID"]
24436 pub target_component: u8,
24437 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24438 #[cfg_attr(
24439 feature = "serde",
24440 serde(
24441 serialize_with = "crate::nulstr::serialize::<_, 16>",
24442 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24443 )
24444 )]
24445 #[cfg_attr(feature = "ts", ts(type = "string"))]
24446 pub param_id: [u8; 16],
24447 #[doc = "Parameter value"]
24448 #[cfg_attr(
24449 feature = "serde",
24450 serde(
24451 serialize_with = "crate::nulstr::serialize::<_, 128>",
24452 deserialize_with = "crate::nulstr::deserialize::<_, 128>"
24453 )
24454 )]
24455 #[cfg_attr(feature = "ts", ts(type = "string"))]
24456 pub param_value: [u8; 128],
24457 #[doc = "Parameter type."]
24458 pub param_type: MavParamExtType,
24459}
24460impl PARAM_EXT_SET_DATA {
24461 pub const ENCODED_LEN: usize = 147usize;
24462 pub const DEFAULT: Self = Self {
24463 target_system: 0_u8,
24464 target_component: 0_u8,
24465 param_id: [0_u8; 16usize],
24466 param_value: [0_u8; 128usize],
24467 param_type: MavParamExtType::DEFAULT,
24468 };
24469 #[cfg(feature = "arbitrary")]
24470 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24471 use arbitrary::{Arbitrary, Unstructured};
24472 let mut buf = [0u8; 1024];
24473 rng.fill_bytes(&mut buf);
24474 let mut unstructured = Unstructured::new(&buf);
24475 Self::arbitrary(&mut unstructured).unwrap_or_default()
24476 }
24477}
24478impl Default for PARAM_EXT_SET_DATA {
24479 fn default() -> Self {
24480 Self::DEFAULT.clone()
24481 }
24482}
24483impl MessageData for PARAM_EXT_SET_DATA {
24484 type Message = MavMessage;
24485 const ID: u32 = 323u32;
24486 const NAME: &'static str = "PARAM_EXT_SET";
24487 const EXTRA_CRC: u8 = 78u8;
24488 const ENCODED_LEN: usize = 147usize;
24489 fn deser(
24490 _version: MavlinkVersion,
24491 __input: &[u8],
24492 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24493 let avail_len = __input.len();
24494 let mut payload_buf = [0; Self::ENCODED_LEN];
24495 let mut buf = if avail_len < Self::ENCODED_LEN {
24496 payload_buf[0..avail_len].copy_from_slice(__input);
24497 Bytes::new(&payload_buf)
24498 } else {
24499 Bytes::new(__input)
24500 };
24501 let mut __struct = Self::default();
24502 __struct.target_system = buf.get_u8();
24503 __struct.target_component = buf.get_u8();
24504 for v in &mut __struct.param_id {
24505 let val = buf.get_u8();
24506 *v = val;
24507 }
24508 for v in &mut __struct.param_value {
24509 let val = buf.get_u8();
24510 *v = val;
24511 }
24512 let tmp = buf.get_u8();
24513 __struct.param_type =
24514 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24515 enum_type: "MavParamExtType",
24516 value: tmp as u32,
24517 })?;
24518 Ok(__struct)
24519 }
24520 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24521 let mut __tmp = BytesMut::new(bytes);
24522 #[allow(clippy::absurd_extreme_comparisons)]
24523 #[allow(unused_comparisons)]
24524 if __tmp.remaining() < Self::ENCODED_LEN {
24525 panic!(
24526 "buffer is too small (need {} bytes, but got {})",
24527 Self::ENCODED_LEN,
24528 __tmp.remaining(),
24529 )
24530 }
24531 __tmp.put_u8(self.target_system);
24532 __tmp.put_u8(self.target_component);
24533 for val in &self.param_id {
24534 __tmp.put_u8(*val);
24535 }
24536 for val in &self.param_value {
24537 __tmp.put_u8(*val);
24538 }
24539 __tmp.put_u8(self.param_type as u8);
24540 if matches!(version, MavlinkVersion::V2) {
24541 let len = __tmp.len();
24542 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24543 } else {
24544 __tmp.len()
24545 }
24546 }
24547}
24548#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
24549#[doc = ""]
24550#[doc = "ID: 322"]
24551#[derive(Debug, Clone, PartialEq)]
24552#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24553#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24554#[cfg_attr(feature = "ts", derive(TS))]
24555#[cfg_attr(feature = "ts", ts(export))]
24556pub struct PARAM_EXT_VALUE_DATA {
24557 #[doc = "Total number of parameters"]
24558 pub param_count: u16,
24559 #[doc = "Index of this parameter"]
24560 pub param_index: u16,
24561 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24562 #[cfg_attr(
24563 feature = "serde",
24564 serde(
24565 serialize_with = "crate::nulstr::serialize::<_, 16>",
24566 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24567 )
24568 )]
24569 #[cfg_attr(feature = "ts", ts(type = "string"))]
24570 pub param_id: [u8; 16],
24571 #[doc = "Parameter value"]
24572 #[cfg_attr(
24573 feature = "serde",
24574 serde(
24575 serialize_with = "crate::nulstr::serialize::<_, 128>",
24576 deserialize_with = "crate::nulstr::deserialize::<_, 128>"
24577 )
24578 )]
24579 #[cfg_attr(feature = "ts", ts(type = "string"))]
24580 pub param_value: [u8; 128],
24581 #[doc = "Parameter type."]
24582 pub param_type: MavParamExtType,
24583}
24584impl PARAM_EXT_VALUE_DATA {
24585 pub const ENCODED_LEN: usize = 149usize;
24586 pub const DEFAULT: Self = Self {
24587 param_count: 0_u16,
24588 param_index: 0_u16,
24589 param_id: [0_u8; 16usize],
24590 param_value: [0_u8; 128usize],
24591 param_type: MavParamExtType::DEFAULT,
24592 };
24593 #[cfg(feature = "arbitrary")]
24594 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24595 use arbitrary::{Arbitrary, Unstructured};
24596 let mut buf = [0u8; 1024];
24597 rng.fill_bytes(&mut buf);
24598 let mut unstructured = Unstructured::new(&buf);
24599 Self::arbitrary(&mut unstructured).unwrap_or_default()
24600 }
24601}
24602impl Default for PARAM_EXT_VALUE_DATA {
24603 fn default() -> Self {
24604 Self::DEFAULT.clone()
24605 }
24606}
24607impl MessageData for PARAM_EXT_VALUE_DATA {
24608 type Message = MavMessage;
24609 const ID: u32 = 322u32;
24610 const NAME: &'static str = "PARAM_EXT_VALUE";
24611 const EXTRA_CRC: u8 = 243u8;
24612 const ENCODED_LEN: usize = 149usize;
24613 fn deser(
24614 _version: MavlinkVersion,
24615 __input: &[u8],
24616 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24617 let avail_len = __input.len();
24618 let mut payload_buf = [0; Self::ENCODED_LEN];
24619 let mut buf = if avail_len < Self::ENCODED_LEN {
24620 payload_buf[0..avail_len].copy_from_slice(__input);
24621 Bytes::new(&payload_buf)
24622 } else {
24623 Bytes::new(__input)
24624 };
24625 let mut __struct = Self::default();
24626 __struct.param_count = buf.get_u16_le();
24627 __struct.param_index = buf.get_u16_le();
24628 for v in &mut __struct.param_id {
24629 let val = buf.get_u8();
24630 *v = val;
24631 }
24632 for v in &mut __struct.param_value {
24633 let val = buf.get_u8();
24634 *v = val;
24635 }
24636 let tmp = buf.get_u8();
24637 __struct.param_type =
24638 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24639 enum_type: "MavParamExtType",
24640 value: tmp as u32,
24641 })?;
24642 Ok(__struct)
24643 }
24644 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24645 let mut __tmp = BytesMut::new(bytes);
24646 #[allow(clippy::absurd_extreme_comparisons)]
24647 #[allow(unused_comparisons)]
24648 if __tmp.remaining() < Self::ENCODED_LEN {
24649 panic!(
24650 "buffer is too small (need {} bytes, but got {})",
24651 Self::ENCODED_LEN,
24652 __tmp.remaining(),
24653 )
24654 }
24655 __tmp.put_u16_le(self.param_count);
24656 __tmp.put_u16_le(self.param_index);
24657 for val in &self.param_id {
24658 __tmp.put_u8(*val);
24659 }
24660 for val in &self.param_value {
24661 __tmp.put_u8(*val);
24662 }
24663 __tmp.put_u8(self.param_type as u8);
24664 if matches!(version, MavlinkVersion::V2) {
24665 let len = __tmp.len();
24666 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24667 } else {
24668 __tmp.len()
24669 }
24670 }
24671}
24672#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
24673#[doc = ""]
24674#[doc = "ID: 50"]
24675#[derive(Debug, Clone, PartialEq)]
24676#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24677#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24678#[cfg_attr(feature = "ts", derive(TS))]
24679#[cfg_attr(feature = "ts", ts(export))]
24680pub struct PARAM_MAP_RC_DATA {
24681 #[doc = "Initial parameter value"]
24682 pub param_value0: f32,
24683 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
24684 pub scale: f32,
24685 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
24686 pub param_value_min: f32,
24687 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
24688 pub param_value_max: f32,
24689 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
24690 pub param_index: i16,
24691 #[doc = "System ID"]
24692 pub target_system: u8,
24693 #[doc = "Component ID"]
24694 pub target_component: u8,
24695 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24696 #[cfg_attr(
24697 feature = "serde",
24698 serde(
24699 serialize_with = "crate::nulstr::serialize::<_, 16>",
24700 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24701 )
24702 )]
24703 #[cfg_attr(feature = "ts", ts(type = "string"))]
24704 pub param_id: [u8; 16],
24705 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
24706 pub parameter_rc_channel_index: u8,
24707}
24708impl PARAM_MAP_RC_DATA {
24709 pub const ENCODED_LEN: usize = 37usize;
24710 pub const DEFAULT: Self = Self {
24711 param_value0: 0.0_f32,
24712 scale: 0.0_f32,
24713 param_value_min: 0.0_f32,
24714 param_value_max: 0.0_f32,
24715 param_index: 0_i16,
24716 target_system: 0_u8,
24717 target_component: 0_u8,
24718 param_id: [0_u8; 16usize],
24719 parameter_rc_channel_index: 0_u8,
24720 };
24721 #[cfg(feature = "arbitrary")]
24722 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24723 use arbitrary::{Arbitrary, Unstructured};
24724 let mut buf = [0u8; 1024];
24725 rng.fill_bytes(&mut buf);
24726 let mut unstructured = Unstructured::new(&buf);
24727 Self::arbitrary(&mut unstructured).unwrap_or_default()
24728 }
24729}
24730impl Default for PARAM_MAP_RC_DATA {
24731 fn default() -> Self {
24732 Self::DEFAULT.clone()
24733 }
24734}
24735impl MessageData for PARAM_MAP_RC_DATA {
24736 type Message = MavMessage;
24737 const ID: u32 = 50u32;
24738 const NAME: &'static str = "PARAM_MAP_RC";
24739 const EXTRA_CRC: u8 = 78u8;
24740 const ENCODED_LEN: usize = 37usize;
24741 fn deser(
24742 _version: MavlinkVersion,
24743 __input: &[u8],
24744 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24745 let avail_len = __input.len();
24746 let mut payload_buf = [0; Self::ENCODED_LEN];
24747 let mut buf = if avail_len < Self::ENCODED_LEN {
24748 payload_buf[0..avail_len].copy_from_slice(__input);
24749 Bytes::new(&payload_buf)
24750 } else {
24751 Bytes::new(__input)
24752 };
24753 let mut __struct = Self::default();
24754 __struct.param_value0 = buf.get_f32_le();
24755 __struct.scale = buf.get_f32_le();
24756 __struct.param_value_min = buf.get_f32_le();
24757 __struct.param_value_max = buf.get_f32_le();
24758 __struct.param_index = buf.get_i16_le();
24759 __struct.target_system = buf.get_u8();
24760 __struct.target_component = buf.get_u8();
24761 for v in &mut __struct.param_id {
24762 let val = buf.get_u8();
24763 *v = val;
24764 }
24765 __struct.parameter_rc_channel_index = buf.get_u8();
24766 Ok(__struct)
24767 }
24768 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24769 let mut __tmp = BytesMut::new(bytes);
24770 #[allow(clippy::absurd_extreme_comparisons)]
24771 #[allow(unused_comparisons)]
24772 if __tmp.remaining() < Self::ENCODED_LEN {
24773 panic!(
24774 "buffer is too small (need {} bytes, but got {})",
24775 Self::ENCODED_LEN,
24776 __tmp.remaining(),
24777 )
24778 }
24779 __tmp.put_f32_le(self.param_value0);
24780 __tmp.put_f32_le(self.scale);
24781 __tmp.put_f32_le(self.param_value_min);
24782 __tmp.put_f32_le(self.param_value_max);
24783 __tmp.put_i16_le(self.param_index);
24784 __tmp.put_u8(self.target_system);
24785 __tmp.put_u8(self.target_component);
24786 for val in &self.param_id {
24787 __tmp.put_u8(*val);
24788 }
24789 __tmp.put_u8(self.parameter_rc_channel_index);
24790 if matches!(version, MavlinkVersion::V2) {
24791 let len = __tmp.len();
24792 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24793 } else {
24794 __tmp.len()
24795 }
24796 }
24797}
24798#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24799#[doc = ""]
24800#[doc = "ID: 21"]
24801#[derive(Debug, Clone, PartialEq)]
24802#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24803#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24804#[cfg_attr(feature = "ts", derive(TS))]
24805#[cfg_attr(feature = "ts", ts(export))]
24806pub struct PARAM_REQUEST_LIST_DATA {
24807 #[doc = "System ID"]
24808 pub target_system: u8,
24809 #[doc = "Component ID"]
24810 pub target_component: u8,
24811}
24812impl PARAM_REQUEST_LIST_DATA {
24813 pub const ENCODED_LEN: usize = 2usize;
24814 pub const DEFAULT: Self = Self {
24815 target_system: 0_u8,
24816 target_component: 0_u8,
24817 };
24818 #[cfg(feature = "arbitrary")]
24819 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24820 use arbitrary::{Arbitrary, Unstructured};
24821 let mut buf = [0u8; 1024];
24822 rng.fill_bytes(&mut buf);
24823 let mut unstructured = Unstructured::new(&buf);
24824 Self::arbitrary(&mut unstructured).unwrap_or_default()
24825 }
24826}
24827impl Default for PARAM_REQUEST_LIST_DATA {
24828 fn default() -> Self {
24829 Self::DEFAULT.clone()
24830 }
24831}
24832impl MessageData for PARAM_REQUEST_LIST_DATA {
24833 type Message = MavMessage;
24834 const ID: u32 = 21u32;
24835 const NAME: &'static str = "PARAM_REQUEST_LIST";
24836 const EXTRA_CRC: u8 = 159u8;
24837 const ENCODED_LEN: usize = 2usize;
24838 fn deser(
24839 _version: MavlinkVersion,
24840 __input: &[u8],
24841 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24842 let avail_len = __input.len();
24843 let mut payload_buf = [0; Self::ENCODED_LEN];
24844 let mut buf = if avail_len < Self::ENCODED_LEN {
24845 payload_buf[0..avail_len].copy_from_slice(__input);
24846 Bytes::new(&payload_buf)
24847 } else {
24848 Bytes::new(__input)
24849 };
24850 let mut __struct = Self::default();
24851 __struct.target_system = buf.get_u8();
24852 __struct.target_component = buf.get_u8();
24853 Ok(__struct)
24854 }
24855 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24856 let mut __tmp = BytesMut::new(bytes);
24857 #[allow(clippy::absurd_extreme_comparisons)]
24858 #[allow(unused_comparisons)]
24859 if __tmp.remaining() < Self::ENCODED_LEN {
24860 panic!(
24861 "buffer is too small (need {} bytes, but got {})",
24862 Self::ENCODED_LEN,
24863 __tmp.remaining(),
24864 )
24865 }
24866 __tmp.put_u8(self.target_system);
24867 __tmp.put_u8(self.target_component);
24868 if matches!(version, MavlinkVersion::V2) {
24869 let len = __tmp.len();
24870 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24871 } else {
24872 __tmp.len()
24873 }
24874 }
24875}
24876#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
24877#[doc = ""]
24878#[doc = "ID: 20"]
24879#[derive(Debug, Clone, PartialEq)]
24880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24882#[cfg_attr(feature = "ts", derive(TS))]
24883#[cfg_attr(feature = "ts", ts(export))]
24884pub struct PARAM_REQUEST_READ_DATA {
24885 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
24886 pub param_index: i16,
24887 #[doc = "System ID"]
24888 pub target_system: u8,
24889 #[doc = "Component ID"]
24890 pub target_component: u8,
24891 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24892 #[cfg_attr(
24893 feature = "serde",
24894 serde(
24895 serialize_with = "crate::nulstr::serialize::<_, 16>",
24896 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24897 )
24898 )]
24899 #[cfg_attr(feature = "ts", ts(type = "string"))]
24900 pub param_id: [u8; 16],
24901}
24902impl PARAM_REQUEST_READ_DATA {
24903 pub const ENCODED_LEN: usize = 20usize;
24904 pub const DEFAULT: Self = Self {
24905 param_index: 0_i16,
24906 target_system: 0_u8,
24907 target_component: 0_u8,
24908 param_id: [0_u8; 16usize],
24909 };
24910 #[cfg(feature = "arbitrary")]
24911 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24912 use arbitrary::{Arbitrary, Unstructured};
24913 let mut buf = [0u8; 1024];
24914 rng.fill_bytes(&mut buf);
24915 let mut unstructured = Unstructured::new(&buf);
24916 Self::arbitrary(&mut unstructured).unwrap_or_default()
24917 }
24918}
24919impl Default for PARAM_REQUEST_READ_DATA {
24920 fn default() -> Self {
24921 Self::DEFAULT.clone()
24922 }
24923}
24924impl MessageData for PARAM_REQUEST_READ_DATA {
24925 type Message = MavMessage;
24926 const ID: u32 = 20u32;
24927 const NAME: &'static str = "PARAM_REQUEST_READ";
24928 const EXTRA_CRC: u8 = 214u8;
24929 const ENCODED_LEN: usize = 20usize;
24930 fn deser(
24931 _version: MavlinkVersion,
24932 __input: &[u8],
24933 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24934 let avail_len = __input.len();
24935 let mut payload_buf = [0; Self::ENCODED_LEN];
24936 let mut buf = if avail_len < Self::ENCODED_LEN {
24937 payload_buf[0..avail_len].copy_from_slice(__input);
24938 Bytes::new(&payload_buf)
24939 } else {
24940 Bytes::new(__input)
24941 };
24942 let mut __struct = Self::default();
24943 __struct.param_index = buf.get_i16_le();
24944 __struct.target_system = buf.get_u8();
24945 __struct.target_component = buf.get_u8();
24946 for v in &mut __struct.param_id {
24947 let val = buf.get_u8();
24948 *v = val;
24949 }
24950 Ok(__struct)
24951 }
24952 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24953 let mut __tmp = BytesMut::new(bytes);
24954 #[allow(clippy::absurd_extreme_comparisons)]
24955 #[allow(unused_comparisons)]
24956 if __tmp.remaining() < Self::ENCODED_LEN {
24957 panic!(
24958 "buffer is too small (need {} bytes, but got {})",
24959 Self::ENCODED_LEN,
24960 __tmp.remaining(),
24961 )
24962 }
24963 __tmp.put_i16_le(self.param_index);
24964 __tmp.put_u8(self.target_system);
24965 __tmp.put_u8(self.target_component);
24966 for val in &self.param_id {
24967 __tmp.put_u8(*val);
24968 }
24969 if matches!(version, MavlinkVersion::V2) {
24970 let len = __tmp.len();
24971 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24972 } else {
24973 __tmp.len()
24974 }
24975 }
24976}
24977#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24978#[doc = ""]
24979#[doc = "ID: 23"]
24980#[derive(Debug, Clone, PartialEq)]
24981#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24982#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24983#[cfg_attr(feature = "ts", derive(TS))]
24984#[cfg_attr(feature = "ts", ts(export))]
24985pub struct PARAM_SET_DATA {
24986 #[doc = "Onboard parameter value"]
24987 pub param_value: f32,
24988 #[doc = "System ID"]
24989 pub target_system: u8,
24990 #[doc = "Component ID"]
24991 pub target_component: u8,
24992 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24993 #[cfg_attr(
24994 feature = "serde",
24995 serde(
24996 serialize_with = "crate::nulstr::serialize::<_, 16>",
24997 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24998 )
24999 )]
25000 #[cfg_attr(feature = "ts", ts(type = "string"))]
25001 pub param_id: [u8; 16],
25002 #[doc = "Onboard parameter type."]
25003 pub param_type: MavParamType,
25004}
25005impl PARAM_SET_DATA {
25006 pub const ENCODED_LEN: usize = 23usize;
25007 pub const DEFAULT: Self = Self {
25008 param_value: 0.0_f32,
25009 target_system: 0_u8,
25010 target_component: 0_u8,
25011 param_id: [0_u8; 16usize],
25012 param_type: MavParamType::DEFAULT,
25013 };
25014 #[cfg(feature = "arbitrary")]
25015 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25016 use arbitrary::{Arbitrary, Unstructured};
25017 let mut buf = [0u8; 1024];
25018 rng.fill_bytes(&mut buf);
25019 let mut unstructured = Unstructured::new(&buf);
25020 Self::arbitrary(&mut unstructured).unwrap_or_default()
25021 }
25022}
25023impl Default for PARAM_SET_DATA {
25024 fn default() -> Self {
25025 Self::DEFAULT.clone()
25026 }
25027}
25028impl MessageData for PARAM_SET_DATA {
25029 type Message = MavMessage;
25030 const ID: u32 = 23u32;
25031 const NAME: &'static str = "PARAM_SET";
25032 const EXTRA_CRC: u8 = 168u8;
25033 const ENCODED_LEN: usize = 23usize;
25034 fn deser(
25035 _version: MavlinkVersion,
25036 __input: &[u8],
25037 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25038 let avail_len = __input.len();
25039 let mut payload_buf = [0; Self::ENCODED_LEN];
25040 let mut buf = if avail_len < Self::ENCODED_LEN {
25041 payload_buf[0..avail_len].copy_from_slice(__input);
25042 Bytes::new(&payload_buf)
25043 } else {
25044 Bytes::new(__input)
25045 };
25046 let mut __struct = Self::default();
25047 __struct.param_value = buf.get_f32_le();
25048 __struct.target_system = buf.get_u8();
25049 __struct.target_component = buf.get_u8();
25050 for v in &mut __struct.param_id {
25051 let val = buf.get_u8();
25052 *v = val;
25053 }
25054 let tmp = buf.get_u8();
25055 __struct.param_type =
25056 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25057 enum_type: "MavParamType",
25058 value: tmp as u32,
25059 })?;
25060 Ok(__struct)
25061 }
25062 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25063 let mut __tmp = BytesMut::new(bytes);
25064 #[allow(clippy::absurd_extreme_comparisons)]
25065 #[allow(unused_comparisons)]
25066 if __tmp.remaining() < Self::ENCODED_LEN {
25067 panic!(
25068 "buffer is too small (need {} bytes, but got {})",
25069 Self::ENCODED_LEN,
25070 __tmp.remaining(),
25071 )
25072 }
25073 __tmp.put_f32_le(self.param_value);
25074 __tmp.put_u8(self.target_system);
25075 __tmp.put_u8(self.target_component);
25076 for val in &self.param_id {
25077 __tmp.put_u8(*val);
25078 }
25079 __tmp.put_u8(self.param_type as u8);
25080 if matches!(version, MavlinkVersion::V2) {
25081 let len = __tmp.len();
25082 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25083 } else {
25084 __tmp.len()
25085 }
25086 }
25087}
25088#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
25089#[doc = ""]
25090#[doc = "ID: 22"]
25091#[derive(Debug, Clone, PartialEq)]
25092#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25093#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25094#[cfg_attr(feature = "ts", derive(TS))]
25095#[cfg_attr(feature = "ts", ts(export))]
25096pub struct PARAM_VALUE_DATA {
25097 #[doc = "Onboard parameter value"]
25098 pub param_value: f32,
25099 #[doc = "Total number of onboard parameters"]
25100 pub param_count: u16,
25101 #[doc = "Index of this onboard parameter"]
25102 pub param_index: u16,
25103 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
25104 #[cfg_attr(
25105 feature = "serde",
25106 serde(
25107 serialize_with = "crate::nulstr::serialize::<_, 16>",
25108 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
25109 )
25110 )]
25111 #[cfg_attr(feature = "ts", ts(type = "string"))]
25112 pub param_id: [u8; 16],
25113 #[doc = "Onboard parameter type."]
25114 pub param_type: MavParamType,
25115}
25116impl PARAM_VALUE_DATA {
25117 pub const ENCODED_LEN: usize = 25usize;
25118 pub const DEFAULT: Self = Self {
25119 param_value: 0.0_f32,
25120 param_count: 0_u16,
25121 param_index: 0_u16,
25122 param_id: [0_u8; 16usize],
25123 param_type: MavParamType::DEFAULT,
25124 };
25125 #[cfg(feature = "arbitrary")]
25126 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25127 use arbitrary::{Arbitrary, Unstructured};
25128 let mut buf = [0u8; 1024];
25129 rng.fill_bytes(&mut buf);
25130 let mut unstructured = Unstructured::new(&buf);
25131 Self::arbitrary(&mut unstructured).unwrap_or_default()
25132 }
25133}
25134impl Default for PARAM_VALUE_DATA {
25135 fn default() -> Self {
25136 Self::DEFAULT.clone()
25137 }
25138}
25139impl MessageData for PARAM_VALUE_DATA {
25140 type Message = MavMessage;
25141 const ID: u32 = 22u32;
25142 const NAME: &'static str = "PARAM_VALUE";
25143 const EXTRA_CRC: u8 = 220u8;
25144 const ENCODED_LEN: usize = 25usize;
25145 fn deser(
25146 _version: MavlinkVersion,
25147 __input: &[u8],
25148 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25149 let avail_len = __input.len();
25150 let mut payload_buf = [0; Self::ENCODED_LEN];
25151 let mut buf = if avail_len < Self::ENCODED_LEN {
25152 payload_buf[0..avail_len].copy_from_slice(__input);
25153 Bytes::new(&payload_buf)
25154 } else {
25155 Bytes::new(__input)
25156 };
25157 let mut __struct = Self::default();
25158 __struct.param_value = buf.get_f32_le();
25159 __struct.param_count = buf.get_u16_le();
25160 __struct.param_index = buf.get_u16_le();
25161 for v in &mut __struct.param_id {
25162 let val = buf.get_u8();
25163 *v = val;
25164 }
25165 let tmp = buf.get_u8();
25166 __struct.param_type =
25167 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25168 enum_type: "MavParamType",
25169 value: tmp as u32,
25170 })?;
25171 Ok(__struct)
25172 }
25173 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25174 let mut __tmp = BytesMut::new(bytes);
25175 #[allow(clippy::absurd_extreme_comparisons)]
25176 #[allow(unused_comparisons)]
25177 if __tmp.remaining() < Self::ENCODED_LEN {
25178 panic!(
25179 "buffer is too small (need {} bytes, but got {})",
25180 Self::ENCODED_LEN,
25181 __tmp.remaining(),
25182 )
25183 }
25184 __tmp.put_f32_le(self.param_value);
25185 __tmp.put_u16_le(self.param_count);
25186 __tmp.put_u16_le(self.param_index);
25187 for val in &self.param_id {
25188 __tmp.put_u8(*val);
25189 }
25190 __tmp.put_u8(self.param_type as u8);
25191 if matches!(version, MavlinkVersion::V2) {
25192 let len = __tmp.len();
25193 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25194 } else {
25195 __tmp.len()
25196 }
25197 }
25198}
25199#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
25200#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
25201#[doc = ""]
25202#[doc = "ID: 4"]
25203#[derive(Debug, Clone, PartialEq)]
25204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25206#[cfg_attr(feature = "ts", derive(TS))]
25207#[cfg_attr(feature = "ts", ts(export))]
25208pub struct PING_DATA {
25209 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25210 pub time_usec: u64,
25211 #[doc = "PING sequence"]
25212 pub seq: u32,
25213 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
25214 pub target_system: u8,
25215 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
25216 pub target_component: u8,
25217}
25218impl PING_DATA {
25219 pub const ENCODED_LEN: usize = 14usize;
25220 pub const DEFAULT: Self = Self {
25221 time_usec: 0_u64,
25222 seq: 0_u32,
25223 target_system: 0_u8,
25224 target_component: 0_u8,
25225 };
25226 #[cfg(feature = "arbitrary")]
25227 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25228 use arbitrary::{Arbitrary, Unstructured};
25229 let mut buf = [0u8; 1024];
25230 rng.fill_bytes(&mut buf);
25231 let mut unstructured = Unstructured::new(&buf);
25232 Self::arbitrary(&mut unstructured).unwrap_or_default()
25233 }
25234}
25235impl Default for PING_DATA {
25236 fn default() -> Self {
25237 Self::DEFAULT.clone()
25238 }
25239}
25240impl MessageData for PING_DATA {
25241 type Message = MavMessage;
25242 const ID: u32 = 4u32;
25243 const NAME: &'static str = "PING";
25244 const EXTRA_CRC: u8 = 237u8;
25245 const ENCODED_LEN: usize = 14usize;
25246 fn deser(
25247 _version: MavlinkVersion,
25248 __input: &[u8],
25249 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25250 let avail_len = __input.len();
25251 let mut payload_buf = [0; Self::ENCODED_LEN];
25252 let mut buf = if avail_len < Self::ENCODED_LEN {
25253 payload_buf[0..avail_len].copy_from_slice(__input);
25254 Bytes::new(&payload_buf)
25255 } else {
25256 Bytes::new(__input)
25257 };
25258 let mut __struct = Self::default();
25259 __struct.time_usec = buf.get_u64_le();
25260 __struct.seq = buf.get_u32_le();
25261 __struct.target_system = buf.get_u8();
25262 __struct.target_component = buf.get_u8();
25263 Ok(__struct)
25264 }
25265 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25266 let mut __tmp = BytesMut::new(bytes);
25267 #[allow(clippy::absurd_extreme_comparisons)]
25268 #[allow(unused_comparisons)]
25269 if __tmp.remaining() < Self::ENCODED_LEN {
25270 panic!(
25271 "buffer is too small (need {} bytes, but got {})",
25272 Self::ENCODED_LEN,
25273 __tmp.remaining(),
25274 )
25275 }
25276 __tmp.put_u64_le(self.time_usec);
25277 __tmp.put_u32_le(self.seq);
25278 __tmp.put_u8(self.target_system);
25279 __tmp.put_u8(self.target_component);
25280 if matches!(version, MavlinkVersion::V2) {
25281 let len = __tmp.len();
25282 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25283 } else {
25284 __tmp.len()
25285 }
25286 }
25287}
25288#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
25289#[doc = "Control vehicle tone generation (buzzer)."]
25290#[doc = ""]
25291#[doc = "ID: 258"]
25292#[derive(Debug, Clone, PartialEq)]
25293#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25294#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25295#[cfg_attr(feature = "ts", derive(TS))]
25296#[cfg_attr(feature = "ts", ts(export))]
25297pub struct PLAY_TUNE_DATA {
25298 #[doc = "System ID"]
25299 pub target_system: u8,
25300 #[doc = "Component ID"]
25301 pub target_component: u8,
25302 #[doc = "tune in board specific format"]
25303 #[cfg_attr(
25304 feature = "serde",
25305 serde(
25306 serialize_with = "crate::nulstr::serialize::<_, 30>",
25307 deserialize_with = "crate::nulstr::deserialize::<_, 30>"
25308 )
25309 )]
25310 #[cfg_attr(feature = "ts", ts(type = "string"))]
25311 pub tune: [u8; 30],
25312 #[doc = "tune extension (appended to tune)"]
25313 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25314 #[cfg_attr(
25315 feature = "serde",
25316 serde(
25317 serialize_with = "crate::nulstr::serialize::<_, 200>",
25318 deserialize_with = "crate::nulstr::deserialize::<_, 200>"
25319 )
25320 )]
25321 #[cfg_attr(feature = "ts", ts(type = "string"))]
25322 pub tune2: [u8; 200],
25323}
25324impl PLAY_TUNE_DATA {
25325 pub const ENCODED_LEN: usize = 232usize;
25326 pub const DEFAULT: Self = Self {
25327 target_system: 0_u8,
25328 target_component: 0_u8,
25329 tune: [0_u8; 30usize],
25330 tune2: [0_u8; 200usize],
25331 };
25332 #[cfg(feature = "arbitrary")]
25333 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25334 use arbitrary::{Arbitrary, Unstructured};
25335 let mut buf = [0u8; 1024];
25336 rng.fill_bytes(&mut buf);
25337 let mut unstructured = Unstructured::new(&buf);
25338 Self::arbitrary(&mut unstructured).unwrap_or_default()
25339 }
25340}
25341impl Default for PLAY_TUNE_DATA {
25342 fn default() -> Self {
25343 Self::DEFAULT.clone()
25344 }
25345}
25346impl MessageData for PLAY_TUNE_DATA {
25347 type Message = MavMessage;
25348 const ID: u32 = 258u32;
25349 const NAME: &'static str = "PLAY_TUNE";
25350 const EXTRA_CRC: u8 = 187u8;
25351 const ENCODED_LEN: usize = 232usize;
25352 fn deser(
25353 _version: MavlinkVersion,
25354 __input: &[u8],
25355 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25356 let avail_len = __input.len();
25357 let mut payload_buf = [0; Self::ENCODED_LEN];
25358 let mut buf = if avail_len < Self::ENCODED_LEN {
25359 payload_buf[0..avail_len].copy_from_slice(__input);
25360 Bytes::new(&payload_buf)
25361 } else {
25362 Bytes::new(__input)
25363 };
25364 let mut __struct = Self::default();
25365 __struct.target_system = buf.get_u8();
25366 __struct.target_component = buf.get_u8();
25367 for v in &mut __struct.tune {
25368 let val = buf.get_u8();
25369 *v = val;
25370 }
25371 for v in &mut __struct.tune2 {
25372 let val = buf.get_u8();
25373 *v = val;
25374 }
25375 Ok(__struct)
25376 }
25377 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25378 let mut __tmp = BytesMut::new(bytes);
25379 #[allow(clippy::absurd_extreme_comparisons)]
25380 #[allow(unused_comparisons)]
25381 if __tmp.remaining() < Self::ENCODED_LEN {
25382 panic!(
25383 "buffer is too small (need {} bytes, but got {})",
25384 Self::ENCODED_LEN,
25385 __tmp.remaining(),
25386 )
25387 }
25388 __tmp.put_u8(self.target_system);
25389 __tmp.put_u8(self.target_component);
25390 for val in &self.tune {
25391 __tmp.put_u8(*val);
25392 }
25393 if matches!(version, MavlinkVersion::V2) {
25394 for val in &self.tune2 {
25395 __tmp.put_u8(*val);
25396 }
25397 let len = __tmp.len();
25398 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25399 } else {
25400 __tmp.len()
25401 }
25402 }
25403}
25404#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
25405#[doc = ""]
25406#[doc = "ID: 400"]
25407#[derive(Debug, Clone, PartialEq)]
25408#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25409#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25410#[cfg_attr(feature = "ts", derive(TS))]
25411#[cfg_attr(feature = "ts", ts(export))]
25412pub struct PLAY_TUNE_V2_DATA {
25413 #[doc = "Tune format"]
25414 pub format: TuneFormat,
25415 #[doc = "System ID"]
25416 pub target_system: u8,
25417 #[doc = "Component ID"]
25418 pub target_component: u8,
25419 #[doc = "Tune definition as a NULL-terminated string."]
25420 #[cfg_attr(
25421 feature = "serde",
25422 serde(
25423 serialize_with = "crate::nulstr::serialize::<_, 248>",
25424 deserialize_with = "crate::nulstr::deserialize::<_, 248>"
25425 )
25426 )]
25427 #[cfg_attr(feature = "ts", ts(type = "string"))]
25428 pub tune: [u8; 248],
25429}
25430impl PLAY_TUNE_V2_DATA {
25431 pub const ENCODED_LEN: usize = 254usize;
25432 pub const DEFAULT: Self = Self {
25433 format: TuneFormat::DEFAULT,
25434 target_system: 0_u8,
25435 target_component: 0_u8,
25436 tune: [0_u8; 248usize],
25437 };
25438 #[cfg(feature = "arbitrary")]
25439 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25440 use arbitrary::{Arbitrary, Unstructured};
25441 let mut buf = [0u8; 1024];
25442 rng.fill_bytes(&mut buf);
25443 let mut unstructured = Unstructured::new(&buf);
25444 Self::arbitrary(&mut unstructured).unwrap_or_default()
25445 }
25446}
25447impl Default for PLAY_TUNE_V2_DATA {
25448 fn default() -> Self {
25449 Self::DEFAULT.clone()
25450 }
25451}
25452impl MessageData for PLAY_TUNE_V2_DATA {
25453 type Message = MavMessage;
25454 const ID: u32 = 400u32;
25455 const NAME: &'static str = "PLAY_TUNE_V2";
25456 const EXTRA_CRC: u8 = 110u8;
25457 const ENCODED_LEN: usize = 254usize;
25458 fn deser(
25459 _version: MavlinkVersion,
25460 __input: &[u8],
25461 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25462 let avail_len = __input.len();
25463 let mut payload_buf = [0; Self::ENCODED_LEN];
25464 let mut buf = if avail_len < Self::ENCODED_LEN {
25465 payload_buf[0..avail_len].copy_from_slice(__input);
25466 Bytes::new(&payload_buf)
25467 } else {
25468 Bytes::new(__input)
25469 };
25470 let mut __struct = Self::default();
25471 let tmp = buf.get_u32_le();
25472 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
25473 ::mavlink_core::error::ParserError::InvalidEnum {
25474 enum_type: "TuneFormat",
25475 value: tmp as u32,
25476 },
25477 )?;
25478 __struct.target_system = buf.get_u8();
25479 __struct.target_component = buf.get_u8();
25480 for v in &mut __struct.tune {
25481 let val = buf.get_u8();
25482 *v = val;
25483 }
25484 Ok(__struct)
25485 }
25486 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25487 let mut __tmp = BytesMut::new(bytes);
25488 #[allow(clippy::absurd_extreme_comparisons)]
25489 #[allow(unused_comparisons)]
25490 if __tmp.remaining() < Self::ENCODED_LEN {
25491 panic!(
25492 "buffer is too small (need {} bytes, but got {})",
25493 Self::ENCODED_LEN,
25494 __tmp.remaining(),
25495 )
25496 }
25497 __tmp.put_u32_le(self.format as u32);
25498 __tmp.put_u8(self.target_system);
25499 __tmp.put_u8(self.target_component);
25500 for val in &self.tune {
25501 __tmp.put_u8(*val);
25502 }
25503 if matches!(version, MavlinkVersion::V2) {
25504 let len = __tmp.len();
25505 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25506 } else {
25507 __tmp.len()
25508 }
25509 }
25510}
25511#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
25512#[doc = ""]
25513#[doc = "ID: 87"]
25514#[derive(Debug, Clone, PartialEq)]
25515#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25516#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25517#[cfg_attr(feature = "ts", derive(TS))]
25518#[cfg_attr(feature = "ts", ts(export))]
25519pub struct POSITION_TARGET_GLOBAL_INT_DATA {
25520 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
25521 pub time_boot_ms: u32,
25522 #[doc = "Latitude in WGS84 frame"]
25523 pub lat_int: i32,
25524 #[doc = "Longitude in WGS84 frame"]
25525 pub lon_int: i32,
25526 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
25527 pub alt: f32,
25528 #[doc = "X velocity in NED frame"]
25529 pub vx: f32,
25530 #[doc = "Y velocity in NED frame"]
25531 pub vy: f32,
25532 #[doc = "Z velocity in NED frame"]
25533 pub vz: f32,
25534 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25535 pub afx: f32,
25536 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25537 pub afy: f32,
25538 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25539 pub afz: f32,
25540 #[doc = "yaw setpoint"]
25541 pub yaw: f32,
25542 #[doc = "yaw rate setpoint"]
25543 pub yaw_rate: f32,
25544 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
25545 pub type_mask: PositionTargetTypemask,
25546 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
25547 pub coordinate_frame: MavFrame,
25548}
25549impl POSITION_TARGET_GLOBAL_INT_DATA {
25550 pub const ENCODED_LEN: usize = 51usize;
25551 pub const DEFAULT: Self = Self {
25552 time_boot_ms: 0_u32,
25553 lat_int: 0_i32,
25554 lon_int: 0_i32,
25555 alt: 0.0_f32,
25556 vx: 0.0_f32,
25557 vy: 0.0_f32,
25558 vz: 0.0_f32,
25559 afx: 0.0_f32,
25560 afy: 0.0_f32,
25561 afz: 0.0_f32,
25562 yaw: 0.0_f32,
25563 yaw_rate: 0.0_f32,
25564 type_mask: PositionTargetTypemask::DEFAULT,
25565 coordinate_frame: MavFrame::DEFAULT,
25566 };
25567 #[cfg(feature = "arbitrary")]
25568 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25569 use arbitrary::{Arbitrary, Unstructured};
25570 let mut buf = [0u8; 1024];
25571 rng.fill_bytes(&mut buf);
25572 let mut unstructured = Unstructured::new(&buf);
25573 Self::arbitrary(&mut unstructured).unwrap_or_default()
25574 }
25575}
25576impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
25577 fn default() -> Self {
25578 Self::DEFAULT.clone()
25579 }
25580}
25581impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
25582 type Message = MavMessage;
25583 const ID: u32 = 87u32;
25584 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
25585 const EXTRA_CRC: u8 = 150u8;
25586 const ENCODED_LEN: usize = 51usize;
25587 fn deser(
25588 _version: MavlinkVersion,
25589 __input: &[u8],
25590 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25591 let avail_len = __input.len();
25592 let mut payload_buf = [0; Self::ENCODED_LEN];
25593 let mut buf = if avail_len < Self::ENCODED_LEN {
25594 payload_buf[0..avail_len].copy_from_slice(__input);
25595 Bytes::new(&payload_buf)
25596 } else {
25597 Bytes::new(__input)
25598 };
25599 let mut __struct = Self::default();
25600 __struct.time_boot_ms = buf.get_u32_le();
25601 __struct.lat_int = buf.get_i32_le();
25602 __struct.lon_int = buf.get_i32_le();
25603 __struct.alt = buf.get_f32_le();
25604 __struct.vx = buf.get_f32_le();
25605 __struct.vy = buf.get_f32_le();
25606 __struct.vz = buf.get_f32_le();
25607 __struct.afx = buf.get_f32_le();
25608 __struct.afy = buf.get_f32_le();
25609 __struct.afz = buf.get_f32_le();
25610 __struct.yaw = buf.get_f32_le();
25611 __struct.yaw_rate = buf.get_f32_le();
25612 let tmp = buf.get_u16_le();
25613 __struct.type_mask = PositionTargetTypemask::from_bits(
25614 tmp & PositionTargetTypemask::all().bits(),
25615 )
25616 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
25617 flag_type: "PositionTargetTypemask",
25618 value: tmp as u32,
25619 })?;
25620 let tmp = buf.get_u8();
25621 __struct.coordinate_frame =
25622 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25623 enum_type: "MavFrame",
25624 value: tmp as u32,
25625 })?;
25626 Ok(__struct)
25627 }
25628 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25629 let mut __tmp = BytesMut::new(bytes);
25630 #[allow(clippy::absurd_extreme_comparisons)]
25631 #[allow(unused_comparisons)]
25632 if __tmp.remaining() < Self::ENCODED_LEN {
25633 panic!(
25634 "buffer is too small (need {} bytes, but got {})",
25635 Self::ENCODED_LEN,
25636 __tmp.remaining(),
25637 )
25638 }
25639 __tmp.put_u32_le(self.time_boot_ms);
25640 __tmp.put_i32_le(self.lat_int);
25641 __tmp.put_i32_le(self.lon_int);
25642 __tmp.put_f32_le(self.alt);
25643 __tmp.put_f32_le(self.vx);
25644 __tmp.put_f32_le(self.vy);
25645 __tmp.put_f32_le(self.vz);
25646 __tmp.put_f32_le(self.afx);
25647 __tmp.put_f32_le(self.afy);
25648 __tmp.put_f32_le(self.afz);
25649 __tmp.put_f32_le(self.yaw);
25650 __tmp.put_f32_le(self.yaw_rate);
25651 __tmp.put_u16_le(self.type_mask.bits());
25652 __tmp.put_u8(self.coordinate_frame as u8);
25653 if matches!(version, MavlinkVersion::V2) {
25654 let len = __tmp.len();
25655 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25656 } else {
25657 __tmp.len()
25658 }
25659 }
25660}
25661#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
25662#[doc = ""]
25663#[doc = "ID: 85"]
25664#[derive(Debug, Clone, PartialEq)]
25665#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25666#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25667#[cfg_attr(feature = "ts", derive(TS))]
25668#[cfg_attr(feature = "ts", ts(export))]
25669pub struct POSITION_TARGET_LOCAL_NED_DATA {
25670 #[doc = "Timestamp (time since system boot)."]
25671 pub time_boot_ms: u32,
25672 #[doc = "X Position in NED frame"]
25673 pub x: f32,
25674 #[doc = "Y Position in NED frame"]
25675 pub y: f32,
25676 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
25677 pub z: f32,
25678 #[doc = "X velocity in NED frame"]
25679 pub vx: f32,
25680 #[doc = "Y velocity in NED frame"]
25681 pub vy: f32,
25682 #[doc = "Z velocity in NED frame"]
25683 pub vz: f32,
25684 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25685 pub afx: f32,
25686 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25687 pub afy: f32,
25688 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25689 pub afz: f32,
25690 #[doc = "yaw setpoint"]
25691 pub yaw: f32,
25692 #[doc = "yaw rate setpoint"]
25693 pub yaw_rate: f32,
25694 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
25695 pub type_mask: PositionTargetTypemask,
25696 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
25697 pub coordinate_frame: MavFrame,
25698}
25699impl POSITION_TARGET_LOCAL_NED_DATA {
25700 pub const ENCODED_LEN: usize = 51usize;
25701 pub const DEFAULT: Self = Self {
25702 time_boot_ms: 0_u32,
25703 x: 0.0_f32,
25704 y: 0.0_f32,
25705 z: 0.0_f32,
25706 vx: 0.0_f32,
25707 vy: 0.0_f32,
25708 vz: 0.0_f32,
25709 afx: 0.0_f32,
25710 afy: 0.0_f32,
25711 afz: 0.0_f32,
25712 yaw: 0.0_f32,
25713 yaw_rate: 0.0_f32,
25714 type_mask: PositionTargetTypemask::DEFAULT,
25715 coordinate_frame: MavFrame::DEFAULT,
25716 };
25717 #[cfg(feature = "arbitrary")]
25718 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25719 use arbitrary::{Arbitrary, Unstructured};
25720 let mut buf = [0u8; 1024];
25721 rng.fill_bytes(&mut buf);
25722 let mut unstructured = Unstructured::new(&buf);
25723 Self::arbitrary(&mut unstructured).unwrap_or_default()
25724 }
25725}
25726impl Default for POSITION_TARGET_LOCAL_NED_DATA {
25727 fn default() -> Self {
25728 Self::DEFAULT.clone()
25729 }
25730}
25731impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
25732 type Message = MavMessage;
25733 const ID: u32 = 85u32;
25734 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
25735 const EXTRA_CRC: u8 = 140u8;
25736 const ENCODED_LEN: usize = 51usize;
25737 fn deser(
25738 _version: MavlinkVersion,
25739 __input: &[u8],
25740 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25741 let avail_len = __input.len();
25742 let mut payload_buf = [0; Self::ENCODED_LEN];
25743 let mut buf = if avail_len < Self::ENCODED_LEN {
25744 payload_buf[0..avail_len].copy_from_slice(__input);
25745 Bytes::new(&payload_buf)
25746 } else {
25747 Bytes::new(__input)
25748 };
25749 let mut __struct = Self::default();
25750 __struct.time_boot_ms = buf.get_u32_le();
25751 __struct.x = buf.get_f32_le();
25752 __struct.y = buf.get_f32_le();
25753 __struct.z = buf.get_f32_le();
25754 __struct.vx = buf.get_f32_le();
25755 __struct.vy = buf.get_f32_le();
25756 __struct.vz = buf.get_f32_le();
25757 __struct.afx = buf.get_f32_le();
25758 __struct.afy = buf.get_f32_le();
25759 __struct.afz = buf.get_f32_le();
25760 __struct.yaw = buf.get_f32_le();
25761 __struct.yaw_rate = buf.get_f32_le();
25762 let tmp = buf.get_u16_le();
25763 __struct.type_mask = PositionTargetTypemask::from_bits(
25764 tmp & PositionTargetTypemask::all().bits(),
25765 )
25766 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
25767 flag_type: "PositionTargetTypemask",
25768 value: tmp as u32,
25769 })?;
25770 let tmp = buf.get_u8();
25771 __struct.coordinate_frame =
25772 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25773 enum_type: "MavFrame",
25774 value: tmp as u32,
25775 })?;
25776 Ok(__struct)
25777 }
25778 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25779 let mut __tmp = BytesMut::new(bytes);
25780 #[allow(clippy::absurd_extreme_comparisons)]
25781 #[allow(unused_comparisons)]
25782 if __tmp.remaining() < Self::ENCODED_LEN {
25783 panic!(
25784 "buffer is too small (need {} bytes, but got {})",
25785 Self::ENCODED_LEN,
25786 __tmp.remaining(),
25787 )
25788 }
25789 __tmp.put_u32_le(self.time_boot_ms);
25790 __tmp.put_f32_le(self.x);
25791 __tmp.put_f32_le(self.y);
25792 __tmp.put_f32_le(self.z);
25793 __tmp.put_f32_le(self.vx);
25794 __tmp.put_f32_le(self.vy);
25795 __tmp.put_f32_le(self.vz);
25796 __tmp.put_f32_le(self.afx);
25797 __tmp.put_f32_le(self.afy);
25798 __tmp.put_f32_le(self.afz);
25799 __tmp.put_f32_le(self.yaw);
25800 __tmp.put_f32_le(self.yaw_rate);
25801 __tmp.put_u16_le(self.type_mask.bits());
25802 __tmp.put_u8(self.coordinate_frame as u8);
25803 if matches!(version, MavlinkVersion::V2) {
25804 let len = __tmp.len();
25805 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25806 } else {
25807 __tmp.len()
25808 }
25809 }
25810}
25811#[doc = "Power supply status."]
25812#[doc = ""]
25813#[doc = "ID: 125"]
25814#[derive(Debug, Clone, PartialEq)]
25815#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25816#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25817#[cfg_attr(feature = "ts", derive(TS))]
25818#[cfg_attr(feature = "ts", ts(export))]
25819pub struct POWER_STATUS_DATA {
25820 #[doc = "5V rail voltage."]
25821 pub Vcc: u16,
25822 #[doc = "Servo rail voltage."]
25823 pub Vservo: u16,
25824 #[doc = "Bitmap of power supply status flags."]
25825 pub flags: MavPowerStatus,
25826}
25827impl POWER_STATUS_DATA {
25828 pub const ENCODED_LEN: usize = 6usize;
25829 pub const DEFAULT: Self = Self {
25830 Vcc: 0_u16,
25831 Vservo: 0_u16,
25832 flags: MavPowerStatus::DEFAULT,
25833 };
25834 #[cfg(feature = "arbitrary")]
25835 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25836 use arbitrary::{Arbitrary, Unstructured};
25837 let mut buf = [0u8; 1024];
25838 rng.fill_bytes(&mut buf);
25839 let mut unstructured = Unstructured::new(&buf);
25840 Self::arbitrary(&mut unstructured).unwrap_or_default()
25841 }
25842}
25843impl Default for POWER_STATUS_DATA {
25844 fn default() -> Self {
25845 Self::DEFAULT.clone()
25846 }
25847}
25848impl MessageData for POWER_STATUS_DATA {
25849 type Message = MavMessage;
25850 const ID: u32 = 125u32;
25851 const NAME: &'static str = "POWER_STATUS";
25852 const EXTRA_CRC: u8 = 203u8;
25853 const ENCODED_LEN: usize = 6usize;
25854 fn deser(
25855 _version: MavlinkVersion,
25856 __input: &[u8],
25857 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25858 let avail_len = __input.len();
25859 let mut payload_buf = [0; Self::ENCODED_LEN];
25860 let mut buf = if avail_len < Self::ENCODED_LEN {
25861 payload_buf[0..avail_len].copy_from_slice(__input);
25862 Bytes::new(&payload_buf)
25863 } else {
25864 Bytes::new(__input)
25865 };
25866 let mut __struct = Self::default();
25867 __struct.Vcc = buf.get_u16_le();
25868 __struct.Vservo = buf.get_u16_le();
25869 let tmp = buf.get_u16_le();
25870 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
25871 ::mavlink_core::error::ParserError::InvalidFlag {
25872 flag_type: "MavPowerStatus",
25873 value: tmp as u32,
25874 },
25875 )?;
25876 Ok(__struct)
25877 }
25878 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25879 let mut __tmp = BytesMut::new(bytes);
25880 #[allow(clippy::absurd_extreme_comparisons)]
25881 #[allow(unused_comparisons)]
25882 if __tmp.remaining() < Self::ENCODED_LEN {
25883 panic!(
25884 "buffer is too small (need {} bytes, but got {})",
25885 Self::ENCODED_LEN,
25886 __tmp.remaining(),
25887 )
25888 }
25889 __tmp.put_u16_le(self.Vcc);
25890 __tmp.put_u16_le(self.Vservo);
25891 __tmp.put_u16_le(self.flags.bits());
25892 if matches!(version, MavlinkVersion::V2) {
25893 let len = __tmp.len();
25894 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25895 } else {
25896 __tmp.len()
25897 }
25898 }
25899}
25900#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
25901#[doc = ""]
25902#[doc = "ID: 300"]
25903#[derive(Debug, Clone, PartialEq)]
25904#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25905#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25906#[cfg_attr(feature = "ts", derive(TS))]
25907#[cfg_attr(feature = "ts", ts(export))]
25908pub struct PROTOCOL_VERSION_DATA {
25909 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
25910 pub version: u16,
25911 #[doc = "Minimum MAVLink version supported"]
25912 pub min_version: u16,
25913 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
25914 pub max_version: u16,
25915 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25916 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25917 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25918 pub spec_version_hash: [u8; 8],
25919 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25920 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25921 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25922 pub library_version_hash: [u8; 8],
25923}
25924impl PROTOCOL_VERSION_DATA {
25925 pub const ENCODED_LEN: usize = 22usize;
25926 pub const DEFAULT: Self = Self {
25927 version: 0_u16,
25928 min_version: 0_u16,
25929 max_version: 0_u16,
25930 spec_version_hash: [0_u8; 8usize],
25931 library_version_hash: [0_u8; 8usize],
25932 };
25933 #[cfg(feature = "arbitrary")]
25934 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25935 use arbitrary::{Arbitrary, Unstructured};
25936 let mut buf = [0u8; 1024];
25937 rng.fill_bytes(&mut buf);
25938 let mut unstructured = Unstructured::new(&buf);
25939 Self::arbitrary(&mut unstructured).unwrap_or_default()
25940 }
25941}
25942impl Default for PROTOCOL_VERSION_DATA {
25943 fn default() -> Self {
25944 Self::DEFAULT.clone()
25945 }
25946}
25947impl MessageData for PROTOCOL_VERSION_DATA {
25948 type Message = MavMessage;
25949 const ID: u32 = 300u32;
25950 const NAME: &'static str = "PROTOCOL_VERSION";
25951 const EXTRA_CRC: u8 = 217u8;
25952 const ENCODED_LEN: usize = 22usize;
25953 fn deser(
25954 _version: MavlinkVersion,
25955 __input: &[u8],
25956 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25957 let avail_len = __input.len();
25958 let mut payload_buf = [0; Self::ENCODED_LEN];
25959 let mut buf = if avail_len < Self::ENCODED_LEN {
25960 payload_buf[0..avail_len].copy_from_slice(__input);
25961 Bytes::new(&payload_buf)
25962 } else {
25963 Bytes::new(__input)
25964 };
25965 let mut __struct = Self::default();
25966 __struct.version = buf.get_u16_le();
25967 __struct.min_version = buf.get_u16_le();
25968 __struct.max_version = buf.get_u16_le();
25969 for v in &mut __struct.spec_version_hash {
25970 let val = buf.get_u8();
25971 *v = val;
25972 }
25973 for v in &mut __struct.library_version_hash {
25974 let val = buf.get_u8();
25975 *v = val;
25976 }
25977 Ok(__struct)
25978 }
25979 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25980 let mut __tmp = BytesMut::new(bytes);
25981 #[allow(clippy::absurd_extreme_comparisons)]
25982 #[allow(unused_comparisons)]
25983 if __tmp.remaining() < Self::ENCODED_LEN {
25984 panic!(
25985 "buffer is too small (need {} bytes, but got {})",
25986 Self::ENCODED_LEN,
25987 __tmp.remaining(),
25988 )
25989 }
25990 __tmp.put_u16_le(self.version);
25991 __tmp.put_u16_le(self.min_version);
25992 __tmp.put_u16_le(self.max_version);
25993 for val in &self.spec_version_hash {
25994 __tmp.put_u8(*val);
25995 }
25996 for val in &self.library_version_hash {
25997 __tmp.put_u8(*val);
25998 }
25999 if matches!(version, MavlinkVersion::V2) {
26000 let len = __tmp.len();
26001 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26002 } else {
26003 __tmp.len()
26004 }
26005 }
26006}
26007#[doc = "Status generated by radio and injected into MAVLink stream."]
26008#[doc = ""]
26009#[doc = "ID: 109"]
26010#[derive(Debug, Clone, PartialEq)]
26011#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26013#[cfg_attr(feature = "ts", derive(TS))]
26014#[cfg_attr(feature = "ts", ts(export))]
26015pub struct RADIO_STATUS_DATA {
26016 #[doc = "Count of radio packet receive errors (since boot)."]
26017 pub rxerrors: u16,
26018 #[doc = "Count of error corrected radio packets (since boot)."]
26019 pub fixed: u16,
26020 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26021 pub rssi: u8,
26022 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26023 pub remrssi: u8,
26024 #[doc = "Remaining free transmitter buffer space."]
26025 pub txbuf: u8,
26026 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
26027 pub noise: u8,
26028 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
26029 pub remnoise: u8,
26030}
26031impl RADIO_STATUS_DATA {
26032 pub const ENCODED_LEN: usize = 9usize;
26033 pub const DEFAULT: Self = Self {
26034 rxerrors: 0_u16,
26035 fixed: 0_u16,
26036 rssi: 0_u8,
26037 remrssi: 0_u8,
26038 txbuf: 0_u8,
26039 noise: 0_u8,
26040 remnoise: 0_u8,
26041 };
26042 #[cfg(feature = "arbitrary")]
26043 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26044 use arbitrary::{Arbitrary, Unstructured};
26045 let mut buf = [0u8; 1024];
26046 rng.fill_bytes(&mut buf);
26047 let mut unstructured = Unstructured::new(&buf);
26048 Self::arbitrary(&mut unstructured).unwrap_or_default()
26049 }
26050}
26051impl Default for RADIO_STATUS_DATA {
26052 fn default() -> Self {
26053 Self::DEFAULT.clone()
26054 }
26055}
26056impl MessageData for RADIO_STATUS_DATA {
26057 type Message = MavMessage;
26058 const ID: u32 = 109u32;
26059 const NAME: &'static str = "RADIO_STATUS";
26060 const EXTRA_CRC: u8 = 185u8;
26061 const ENCODED_LEN: usize = 9usize;
26062 fn deser(
26063 _version: MavlinkVersion,
26064 __input: &[u8],
26065 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26066 let avail_len = __input.len();
26067 let mut payload_buf = [0; Self::ENCODED_LEN];
26068 let mut buf = if avail_len < Self::ENCODED_LEN {
26069 payload_buf[0..avail_len].copy_from_slice(__input);
26070 Bytes::new(&payload_buf)
26071 } else {
26072 Bytes::new(__input)
26073 };
26074 let mut __struct = Self::default();
26075 __struct.rxerrors = buf.get_u16_le();
26076 __struct.fixed = buf.get_u16_le();
26077 __struct.rssi = buf.get_u8();
26078 __struct.remrssi = buf.get_u8();
26079 __struct.txbuf = buf.get_u8();
26080 __struct.noise = buf.get_u8();
26081 __struct.remnoise = buf.get_u8();
26082 Ok(__struct)
26083 }
26084 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26085 let mut __tmp = BytesMut::new(bytes);
26086 #[allow(clippy::absurd_extreme_comparisons)]
26087 #[allow(unused_comparisons)]
26088 if __tmp.remaining() < Self::ENCODED_LEN {
26089 panic!(
26090 "buffer is too small (need {} bytes, but got {})",
26091 Self::ENCODED_LEN,
26092 __tmp.remaining(),
26093 )
26094 }
26095 __tmp.put_u16_le(self.rxerrors);
26096 __tmp.put_u16_le(self.fixed);
26097 __tmp.put_u8(self.rssi);
26098 __tmp.put_u8(self.remrssi);
26099 __tmp.put_u8(self.txbuf);
26100 __tmp.put_u8(self.noise);
26101 __tmp.put_u8(self.remnoise);
26102 if matches!(version, MavlinkVersion::V2) {
26103 let len = __tmp.len();
26104 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26105 } else {
26106 __tmp.len()
26107 }
26108 }
26109}
26110#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
26111#[doc = ""]
26112#[doc = "ID: 27"]
26113#[derive(Debug, Clone, PartialEq)]
26114#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26115#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26116#[cfg_attr(feature = "ts", derive(TS))]
26117#[cfg_attr(feature = "ts", ts(export))]
26118pub struct RAW_IMU_DATA {
26119 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26120 pub time_usec: u64,
26121 #[doc = "X acceleration (raw)"]
26122 pub xacc: i16,
26123 #[doc = "Y acceleration (raw)"]
26124 pub yacc: i16,
26125 #[doc = "Z acceleration (raw)"]
26126 pub zacc: i16,
26127 #[doc = "Angular speed around X axis (raw)"]
26128 pub xgyro: i16,
26129 #[doc = "Angular speed around Y axis (raw)"]
26130 pub ygyro: i16,
26131 #[doc = "Angular speed around Z axis (raw)"]
26132 pub zgyro: i16,
26133 #[doc = "X Magnetic field (raw)"]
26134 pub xmag: i16,
26135 #[doc = "Y Magnetic field (raw)"]
26136 pub ymag: i16,
26137 #[doc = "Z Magnetic field (raw)"]
26138 pub zmag: i16,
26139 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
26140 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26141 pub id: u8,
26142 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26143 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26144 pub temperature: i16,
26145}
26146impl RAW_IMU_DATA {
26147 pub const ENCODED_LEN: usize = 29usize;
26148 pub const DEFAULT: Self = Self {
26149 time_usec: 0_u64,
26150 xacc: 0_i16,
26151 yacc: 0_i16,
26152 zacc: 0_i16,
26153 xgyro: 0_i16,
26154 ygyro: 0_i16,
26155 zgyro: 0_i16,
26156 xmag: 0_i16,
26157 ymag: 0_i16,
26158 zmag: 0_i16,
26159 id: 0_u8,
26160 temperature: 0_i16,
26161 };
26162 #[cfg(feature = "arbitrary")]
26163 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26164 use arbitrary::{Arbitrary, Unstructured};
26165 let mut buf = [0u8; 1024];
26166 rng.fill_bytes(&mut buf);
26167 let mut unstructured = Unstructured::new(&buf);
26168 Self::arbitrary(&mut unstructured).unwrap_or_default()
26169 }
26170}
26171impl Default for RAW_IMU_DATA {
26172 fn default() -> Self {
26173 Self::DEFAULT.clone()
26174 }
26175}
26176impl MessageData for RAW_IMU_DATA {
26177 type Message = MavMessage;
26178 const ID: u32 = 27u32;
26179 const NAME: &'static str = "RAW_IMU";
26180 const EXTRA_CRC: u8 = 144u8;
26181 const ENCODED_LEN: usize = 29usize;
26182 fn deser(
26183 _version: MavlinkVersion,
26184 __input: &[u8],
26185 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26186 let avail_len = __input.len();
26187 let mut payload_buf = [0; Self::ENCODED_LEN];
26188 let mut buf = if avail_len < Self::ENCODED_LEN {
26189 payload_buf[0..avail_len].copy_from_slice(__input);
26190 Bytes::new(&payload_buf)
26191 } else {
26192 Bytes::new(__input)
26193 };
26194 let mut __struct = Self::default();
26195 __struct.time_usec = buf.get_u64_le();
26196 __struct.xacc = buf.get_i16_le();
26197 __struct.yacc = buf.get_i16_le();
26198 __struct.zacc = buf.get_i16_le();
26199 __struct.xgyro = buf.get_i16_le();
26200 __struct.ygyro = buf.get_i16_le();
26201 __struct.zgyro = buf.get_i16_le();
26202 __struct.xmag = buf.get_i16_le();
26203 __struct.ymag = buf.get_i16_le();
26204 __struct.zmag = buf.get_i16_le();
26205 __struct.id = buf.get_u8();
26206 __struct.temperature = buf.get_i16_le();
26207 Ok(__struct)
26208 }
26209 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26210 let mut __tmp = BytesMut::new(bytes);
26211 #[allow(clippy::absurd_extreme_comparisons)]
26212 #[allow(unused_comparisons)]
26213 if __tmp.remaining() < Self::ENCODED_LEN {
26214 panic!(
26215 "buffer is too small (need {} bytes, but got {})",
26216 Self::ENCODED_LEN,
26217 __tmp.remaining(),
26218 )
26219 }
26220 __tmp.put_u64_le(self.time_usec);
26221 __tmp.put_i16_le(self.xacc);
26222 __tmp.put_i16_le(self.yacc);
26223 __tmp.put_i16_le(self.zacc);
26224 __tmp.put_i16_le(self.xgyro);
26225 __tmp.put_i16_le(self.ygyro);
26226 __tmp.put_i16_le(self.zgyro);
26227 __tmp.put_i16_le(self.xmag);
26228 __tmp.put_i16_le(self.ymag);
26229 __tmp.put_i16_le(self.zmag);
26230 if matches!(version, MavlinkVersion::V2) {
26231 __tmp.put_u8(self.id);
26232 __tmp.put_i16_le(self.temperature);
26233 let len = __tmp.len();
26234 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26235 } else {
26236 __tmp.len()
26237 }
26238 }
26239}
26240#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
26241#[doc = ""]
26242#[doc = "ID: 28"]
26243#[derive(Debug, Clone, PartialEq)]
26244#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26245#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26246#[cfg_attr(feature = "ts", derive(TS))]
26247#[cfg_attr(feature = "ts", ts(export))]
26248pub struct RAW_PRESSURE_DATA {
26249 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26250 pub time_usec: u64,
26251 #[doc = "Absolute pressure (raw)"]
26252 pub press_abs: i16,
26253 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
26254 pub press_diff1: i16,
26255 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
26256 pub press_diff2: i16,
26257 #[doc = "Raw Temperature measurement (raw)"]
26258 pub temperature: i16,
26259}
26260impl RAW_PRESSURE_DATA {
26261 pub const ENCODED_LEN: usize = 16usize;
26262 pub const DEFAULT: Self = Self {
26263 time_usec: 0_u64,
26264 press_abs: 0_i16,
26265 press_diff1: 0_i16,
26266 press_diff2: 0_i16,
26267 temperature: 0_i16,
26268 };
26269 #[cfg(feature = "arbitrary")]
26270 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26271 use arbitrary::{Arbitrary, Unstructured};
26272 let mut buf = [0u8; 1024];
26273 rng.fill_bytes(&mut buf);
26274 let mut unstructured = Unstructured::new(&buf);
26275 Self::arbitrary(&mut unstructured).unwrap_or_default()
26276 }
26277}
26278impl Default for RAW_PRESSURE_DATA {
26279 fn default() -> Self {
26280 Self::DEFAULT.clone()
26281 }
26282}
26283impl MessageData for RAW_PRESSURE_DATA {
26284 type Message = MavMessage;
26285 const ID: u32 = 28u32;
26286 const NAME: &'static str = "RAW_PRESSURE";
26287 const EXTRA_CRC: u8 = 67u8;
26288 const ENCODED_LEN: usize = 16usize;
26289 fn deser(
26290 _version: MavlinkVersion,
26291 __input: &[u8],
26292 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26293 let avail_len = __input.len();
26294 let mut payload_buf = [0; Self::ENCODED_LEN];
26295 let mut buf = if avail_len < Self::ENCODED_LEN {
26296 payload_buf[0..avail_len].copy_from_slice(__input);
26297 Bytes::new(&payload_buf)
26298 } else {
26299 Bytes::new(__input)
26300 };
26301 let mut __struct = Self::default();
26302 __struct.time_usec = buf.get_u64_le();
26303 __struct.press_abs = buf.get_i16_le();
26304 __struct.press_diff1 = buf.get_i16_le();
26305 __struct.press_diff2 = buf.get_i16_le();
26306 __struct.temperature = buf.get_i16_le();
26307 Ok(__struct)
26308 }
26309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26310 let mut __tmp = BytesMut::new(bytes);
26311 #[allow(clippy::absurd_extreme_comparisons)]
26312 #[allow(unused_comparisons)]
26313 if __tmp.remaining() < Self::ENCODED_LEN {
26314 panic!(
26315 "buffer is too small (need {} bytes, but got {})",
26316 Self::ENCODED_LEN,
26317 __tmp.remaining(),
26318 )
26319 }
26320 __tmp.put_u64_le(self.time_usec);
26321 __tmp.put_i16_le(self.press_abs);
26322 __tmp.put_i16_le(self.press_diff1);
26323 __tmp.put_i16_le(self.press_diff2);
26324 __tmp.put_i16_le(self.temperature);
26325 if matches!(version, MavlinkVersion::V2) {
26326 let len = __tmp.len();
26327 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26328 } else {
26329 __tmp.len()
26330 }
26331 }
26332}
26333#[doc = "RPM sensor data message."]
26334#[doc = ""]
26335#[doc = "ID: 339"]
26336#[derive(Debug, Clone, PartialEq)]
26337#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26338#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26339#[cfg_attr(feature = "ts", derive(TS))]
26340#[cfg_attr(feature = "ts", ts(export))]
26341pub struct RAW_RPM_DATA {
26342 #[doc = "Indicated rate"]
26343 pub frequency: f32,
26344 #[doc = "Index of this RPM sensor (0-indexed)"]
26345 pub index: u8,
26346}
26347impl RAW_RPM_DATA {
26348 pub const ENCODED_LEN: usize = 5usize;
26349 pub const DEFAULT: Self = Self {
26350 frequency: 0.0_f32,
26351 index: 0_u8,
26352 };
26353 #[cfg(feature = "arbitrary")]
26354 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26355 use arbitrary::{Arbitrary, Unstructured};
26356 let mut buf = [0u8; 1024];
26357 rng.fill_bytes(&mut buf);
26358 let mut unstructured = Unstructured::new(&buf);
26359 Self::arbitrary(&mut unstructured).unwrap_or_default()
26360 }
26361}
26362impl Default for RAW_RPM_DATA {
26363 fn default() -> Self {
26364 Self::DEFAULT.clone()
26365 }
26366}
26367impl MessageData for RAW_RPM_DATA {
26368 type Message = MavMessage;
26369 const ID: u32 = 339u32;
26370 const NAME: &'static str = "RAW_RPM";
26371 const EXTRA_CRC: u8 = 199u8;
26372 const ENCODED_LEN: usize = 5usize;
26373 fn deser(
26374 _version: MavlinkVersion,
26375 __input: &[u8],
26376 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26377 let avail_len = __input.len();
26378 let mut payload_buf = [0; Self::ENCODED_LEN];
26379 let mut buf = if avail_len < Self::ENCODED_LEN {
26380 payload_buf[0..avail_len].copy_from_slice(__input);
26381 Bytes::new(&payload_buf)
26382 } else {
26383 Bytes::new(__input)
26384 };
26385 let mut __struct = Self::default();
26386 __struct.frequency = buf.get_f32_le();
26387 __struct.index = buf.get_u8();
26388 Ok(__struct)
26389 }
26390 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26391 let mut __tmp = BytesMut::new(bytes);
26392 #[allow(clippy::absurd_extreme_comparisons)]
26393 #[allow(unused_comparisons)]
26394 if __tmp.remaining() < Self::ENCODED_LEN {
26395 panic!(
26396 "buffer is too small (need {} bytes, but got {})",
26397 Self::ENCODED_LEN,
26398 __tmp.remaining(),
26399 )
26400 }
26401 __tmp.put_f32_le(self.frequency);
26402 __tmp.put_u8(self.index);
26403 if matches!(version, MavlinkVersion::V2) {
26404 let len = __tmp.len();
26405 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26406 } else {
26407 __tmp.len()
26408 }
26409 }
26410}
26411#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
26412#[doc = ""]
26413#[doc = "ID: 65"]
26414#[derive(Debug, Clone, PartialEq)]
26415#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26416#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26417#[cfg_attr(feature = "ts", derive(TS))]
26418#[cfg_attr(feature = "ts", ts(export))]
26419pub struct RC_CHANNELS_DATA {
26420 #[doc = "Timestamp (time since system boot)."]
26421 pub time_boot_ms: u32,
26422 #[doc = "RC channel 1 value."]
26423 pub chan1_raw: u16,
26424 #[doc = "RC channel 2 value."]
26425 pub chan2_raw: u16,
26426 #[doc = "RC channel 3 value."]
26427 pub chan3_raw: u16,
26428 #[doc = "RC channel 4 value."]
26429 pub chan4_raw: u16,
26430 #[doc = "RC channel 5 value."]
26431 pub chan5_raw: u16,
26432 #[doc = "RC channel 6 value."]
26433 pub chan6_raw: u16,
26434 #[doc = "RC channel 7 value."]
26435 pub chan7_raw: u16,
26436 #[doc = "RC channel 8 value."]
26437 pub chan8_raw: u16,
26438 #[doc = "RC channel 9 value."]
26439 pub chan9_raw: u16,
26440 #[doc = "RC channel 10 value."]
26441 pub chan10_raw: u16,
26442 #[doc = "RC channel 11 value."]
26443 pub chan11_raw: u16,
26444 #[doc = "RC channel 12 value."]
26445 pub chan12_raw: u16,
26446 #[doc = "RC channel 13 value."]
26447 pub chan13_raw: u16,
26448 #[doc = "RC channel 14 value."]
26449 pub chan14_raw: u16,
26450 #[doc = "RC channel 15 value."]
26451 pub chan15_raw: u16,
26452 #[doc = "RC channel 16 value."]
26453 pub chan16_raw: u16,
26454 #[doc = "RC channel 17 value."]
26455 pub chan17_raw: u16,
26456 #[doc = "RC channel 18 value."]
26457 pub chan18_raw: u16,
26458 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
26459 pub chancount: u8,
26460 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26461 pub rssi: u8,
26462}
26463impl RC_CHANNELS_DATA {
26464 pub const ENCODED_LEN: usize = 42usize;
26465 pub const DEFAULT: Self = Self {
26466 time_boot_ms: 0_u32,
26467 chan1_raw: 0_u16,
26468 chan2_raw: 0_u16,
26469 chan3_raw: 0_u16,
26470 chan4_raw: 0_u16,
26471 chan5_raw: 0_u16,
26472 chan6_raw: 0_u16,
26473 chan7_raw: 0_u16,
26474 chan8_raw: 0_u16,
26475 chan9_raw: 0_u16,
26476 chan10_raw: 0_u16,
26477 chan11_raw: 0_u16,
26478 chan12_raw: 0_u16,
26479 chan13_raw: 0_u16,
26480 chan14_raw: 0_u16,
26481 chan15_raw: 0_u16,
26482 chan16_raw: 0_u16,
26483 chan17_raw: 0_u16,
26484 chan18_raw: 0_u16,
26485 chancount: 0_u8,
26486 rssi: 0_u8,
26487 };
26488 #[cfg(feature = "arbitrary")]
26489 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26490 use arbitrary::{Arbitrary, Unstructured};
26491 let mut buf = [0u8; 1024];
26492 rng.fill_bytes(&mut buf);
26493 let mut unstructured = Unstructured::new(&buf);
26494 Self::arbitrary(&mut unstructured).unwrap_or_default()
26495 }
26496}
26497impl Default for RC_CHANNELS_DATA {
26498 fn default() -> Self {
26499 Self::DEFAULT.clone()
26500 }
26501}
26502impl MessageData for RC_CHANNELS_DATA {
26503 type Message = MavMessage;
26504 const ID: u32 = 65u32;
26505 const NAME: &'static str = "RC_CHANNELS";
26506 const EXTRA_CRC: u8 = 118u8;
26507 const ENCODED_LEN: usize = 42usize;
26508 fn deser(
26509 _version: MavlinkVersion,
26510 __input: &[u8],
26511 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26512 let avail_len = __input.len();
26513 let mut payload_buf = [0; Self::ENCODED_LEN];
26514 let mut buf = if avail_len < Self::ENCODED_LEN {
26515 payload_buf[0..avail_len].copy_from_slice(__input);
26516 Bytes::new(&payload_buf)
26517 } else {
26518 Bytes::new(__input)
26519 };
26520 let mut __struct = Self::default();
26521 __struct.time_boot_ms = buf.get_u32_le();
26522 __struct.chan1_raw = buf.get_u16_le();
26523 __struct.chan2_raw = buf.get_u16_le();
26524 __struct.chan3_raw = buf.get_u16_le();
26525 __struct.chan4_raw = buf.get_u16_le();
26526 __struct.chan5_raw = buf.get_u16_le();
26527 __struct.chan6_raw = buf.get_u16_le();
26528 __struct.chan7_raw = buf.get_u16_le();
26529 __struct.chan8_raw = buf.get_u16_le();
26530 __struct.chan9_raw = buf.get_u16_le();
26531 __struct.chan10_raw = buf.get_u16_le();
26532 __struct.chan11_raw = buf.get_u16_le();
26533 __struct.chan12_raw = buf.get_u16_le();
26534 __struct.chan13_raw = buf.get_u16_le();
26535 __struct.chan14_raw = buf.get_u16_le();
26536 __struct.chan15_raw = buf.get_u16_le();
26537 __struct.chan16_raw = buf.get_u16_le();
26538 __struct.chan17_raw = buf.get_u16_le();
26539 __struct.chan18_raw = buf.get_u16_le();
26540 __struct.chancount = buf.get_u8();
26541 __struct.rssi = buf.get_u8();
26542 Ok(__struct)
26543 }
26544 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26545 let mut __tmp = BytesMut::new(bytes);
26546 #[allow(clippy::absurd_extreme_comparisons)]
26547 #[allow(unused_comparisons)]
26548 if __tmp.remaining() < Self::ENCODED_LEN {
26549 panic!(
26550 "buffer is too small (need {} bytes, but got {})",
26551 Self::ENCODED_LEN,
26552 __tmp.remaining(),
26553 )
26554 }
26555 __tmp.put_u32_le(self.time_boot_ms);
26556 __tmp.put_u16_le(self.chan1_raw);
26557 __tmp.put_u16_le(self.chan2_raw);
26558 __tmp.put_u16_le(self.chan3_raw);
26559 __tmp.put_u16_le(self.chan4_raw);
26560 __tmp.put_u16_le(self.chan5_raw);
26561 __tmp.put_u16_le(self.chan6_raw);
26562 __tmp.put_u16_le(self.chan7_raw);
26563 __tmp.put_u16_le(self.chan8_raw);
26564 __tmp.put_u16_le(self.chan9_raw);
26565 __tmp.put_u16_le(self.chan10_raw);
26566 __tmp.put_u16_le(self.chan11_raw);
26567 __tmp.put_u16_le(self.chan12_raw);
26568 __tmp.put_u16_le(self.chan13_raw);
26569 __tmp.put_u16_le(self.chan14_raw);
26570 __tmp.put_u16_le(self.chan15_raw);
26571 __tmp.put_u16_le(self.chan16_raw);
26572 __tmp.put_u16_le(self.chan17_raw);
26573 __tmp.put_u16_le(self.chan18_raw);
26574 __tmp.put_u8(self.chancount);
26575 __tmp.put_u8(self.rssi);
26576 if matches!(version, MavlinkVersion::V2) {
26577 let len = __tmp.len();
26578 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26579 } else {
26580 __tmp.len()
26581 }
26582 }
26583}
26584#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
26585#[doc = ""]
26586#[doc = "ID: 70"]
26587#[derive(Debug, Clone, PartialEq)]
26588#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26589#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26590#[cfg_attr(feature = "ts", derive(TS))]
26591#[cfg_attr(feature = "ts", ts(export))]
26592pub struct RC_CHANNELS_OVERRIDE_DATA {
26593 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26594 pub chan1_raw: u16,
26595 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26596 pub chan2_raw: u16,
26597 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26598 pub chan3_raw: u16,
26599 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26600 pub chan4_raw: u16,
26601 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26602 pub chan5_raw: u16,
26603 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26604 pub chan6_raw: u16,
26605 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26606 pub chan7_raw: u16,
26607 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26608 pub chan8_raw: u16,
26609 #[doc = "System ID"]
26610 pub target_system: u8,
26611 #[doc = "Component ID"]
26612 pub target_component: u8,
26613 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26614 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26615 pub chan9_raw: u16,
26616 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26617 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26618 pub chan10_raw: u16,
26619 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26620 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26621 pub chan11_raw: u16,
26622 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26623 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26624 pub chan12_raw: u16,
26625 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26626 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26627 pub chan13_raw: u16,
26628 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26629 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26630 pub chan14_raw: u16,
26631 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26632 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26633 pub chan15_raw: u16,
26634 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26635 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26636 pub chan16_raw: u16,
26637 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26638 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26639 pub chan17_raw: u16,
26640 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26641 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26642 pub chan18_raw: u16,
26643}
26644impl RC_CHANNELS_OVERRIDE_DATA {
26645 pub const ENCODED_LEN: usize = 38usize;
26646 pub const DEFAULT: Self = Self {
26647 chan1_raw: 0_u16,
26648 chan2_raw: 0_u16,
26649 chan3_raw: 0_u16,
26650 chan4_raw: 0_u16,
26651 chan5_raw: 0_u16,
26652 chan6_raw: 0_u16,
26653 chan7_raw: 0_u16,
26654 chan8_raw: 0_u16,
26655 target_system: 0_u8,
26656 target_component: 0_u8,
26657 chan9_raw: 0_u16,
26658 chan10_raw: 0_u16,
26659 chan11_raw: 0_u16,
26660 chan12_raw: 0_u16,
26661 chan13_raw: 0_u16,
26662 chan14_raw: 0_u16,
26663 chan15_raw: 0_u16,
26664 chan16_raw: 0_u16,
26665 chan17_raw: 0_u16,
26666 chan18_raw: 0_u16,
26667 };
26668 #[cfg(feature = "arbitrary")]
26669 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26670 use arbitrary::{Arbitrary, Unstructured};
26671 let mut buf = [0u8; 1024];
26672 rng.fill_bytes(&mut buf);
26673 let mut unstructured = Unstructured::new(&buf);
26674 Self::arbitrary(&mut unstructured).unwrap_or_default()
26675 }
26676}
26677impl Default for RC_CHANNELS_OVERRIDE_DATA {
26678 fn default() -> Self {
26679 Self::DEFAULT.clone()
26680 }
26681}
26682impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
26683 type Message = MavMessage;
26684 const ID: u32 = 70u32;
26685 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
26686 const EXTRA_CRC: u8 = 124u8;
26687 const ENCODED_LEN: usize = 38usize;
26688 fn deser(
26689 _version: MavlinkVersion,
26690 __input: &[u8],
26691 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26692 let avail_len = __input.len();
26693 let mut payload_buf = [0; Self::ENCODED_LEN];
26694 let mut buf = if avail_len < Self::ENCODED_LEN {
26695 payload_buf[0..avail_len].copy_from_slice(__input);
26696 Bytes::new(&payload_buf)
26697 } else {
26698 Bytes::new(__input)
26699 };
26700 let mut __struct = Self::default();
26701 __struct.chan1_raw = buf.get_u16_le();
26702 __struct.chan2_raw = buf.get_u16_le();
26703 __struct.chan3_raw = buf.get_u16_le();
26704 __struct.chan4_raw = buf.get_u16_le();
26705 __struct.chan5_raw = buf.get_u16_le();
26706 __struct.chan6_raw = buf.get_u16_le();
26707 __struct.chan7_raw = buf.get_u16_le();
26708 __struct.chan8_raw = buf.get_u16_le();
26709 __struct.target_system = buf.get_u8();
26710 __struct.target_component = buf.get_u8();
26711 __struct.chan9_raw = buf.get_u16_le();
26712 __struct.chan10_raw = buf.get_u16_le();
26713 __struct.chan11_raw = buf.get_u16_le();
26714 __struct.chan12_raw = buf.get_u16_le();
26715 __struct.chan13_raw = buf.get_u16_le();
26716 __struct.chan14_raw = buf.get_u16_le();
26717 __struct.chan15_raw = buf.get_u16_le();
26718 __struct.chan16_raw = buf.get_u16_le();
26719 __struct.chan17_raw = buf.get_u16_le();
26720 __struct.chan18_raw = buf.get_u16_le();
26721 Ok(__struct)
26722 }
26723 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26724 let mut __tmp = BytesMut::new(bytes);
26725 #[allow(clippy::absurd_extreme_comparisons)]
26726 #[allow(unused_comparisons)]
26727 if __tmp.remaining() < Self::ENCODED_LEN {
26728 panic!(
26729 "buffer is too small (need {} bytes, but got {})",
26730 Self::ENCODED_LEN,
26731 __tmp.remaining(),
26732 )
26733 }
26734 __tmp.put_u16_le(self.chan1_raw);
26735 __tmp.put_u16_le(self.chan2_raw);
26736 __tmp.put_u16_le(self.chan3_raw);
26737 __tmp.put_u16_le(self.chan4_raw);
26738 __tmp.put_u16_le(self.chan5_raw);
26739 __tmp.put_u16_le(self.chan6_raw);
26740 __tmp.put_u16_le(self.chan7_raw);
26741 __tmp.put_u16_le(self.chan8_raw);
26742 __tmp.put_u8(self.target_system);
26743 __tmp.put_u8(self.target_component);
26744 if matches!(version, MavlinkVersion::V2) {
26745 __tmp.put_u16_le(self.chan9_raw);
26746 __tmp.put_u16_le(self.chan10_raw);
26747 __tmp.put_u16_le(self.chan11_raw);
26748 __tmp.put_u16_le(self.chan12_raw);
26749 __tmp.put_u16_le(self.chan13_raw);
26750 __tmp.put_u16_le(self.chan14_raw);
26751 __tmp.put_u16_le(self.chan15_raw);
26752 __tmp.put_u16_le(self.chan16_raw);
26753 __tmp.put_u16_le(self.chan17_raw);
26754 __tmp.put_u16_le(self.chan18_raw);
26755 let len = __tmp.len();
26756 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26757 } else {
26758 __tmp.len()
26759 }
26760 }
26761}
26762#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
26763#[doc = ""]
26764#[doc = "ID: 35"]
26765#[derive(Debug, Clone, PartialEq)]
26766#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26767#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26768#[cfg_attr(feature = "ts", derive(TS))]
26769#[cfg_attr(feature = "ts", ts(export))]
26770pub struct RC_CHANNELS_RAW_DATA {
26771 #[doc = "Timestamp (time since system boot)."]
26772 pub time_boot_ms: u32,
26773 #[doc = "RC channel 1 value."]
26774 pub chan1_raw: u16,
26775 #[doc = "RC channel 2 value."]
26776 pub chan2_raw: u16,
26777 #[doc = "RC channel 3 value."]
26778 pub chan3_raw: u16,
26779 #[doc = "RC channel 4 value."]
26780 pub chan4_raw: u16,
26781 #[doc = "RC channel 5 value."]
26782 pub chan5_raw: u16,
26783 #[doc = "RC channel 6 value."]
26784 pub chan6_raw: u16,
26785 #[doc = "RC channel 7 value."]
26786 pub chan7_raw: u16,
26787 #[doc = "RC channel 8 value."]
26788 pub chan8_raw: u16,
26789 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26790 pub port: u8,
26791 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26792 pub rssi: u8,
26793}
26794impl RC_CHANNELS_RAW_DATA {
26795 pub const ENCODED_LEN: usize = 22usize;
26796 pub const DEFAULT: Self = Self {
26797 time_boot_ms: 0_u32,
26798 chan1_raw: 0_u16,
26799 chan2_raw: 0_u16,
26800 chan3_raw: 0_u16,
26801 chan4_raw: 0_u16,
26802 chan5_raw: 0_u16,
26803 chan6_raw: 0_u16,
26804 chan7_raw: 0_u16,
26805 chan8_raw: 0_u16,
26806 port: 0_u8,
26807 rssi: 0_u8,
26808 };
26809 #[cfg(feature = "arbitrary")]
26810 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26811 use arbitrary::{Arbitrary, Unstructured};
26812 let mut buf = [0u8; 1024];
26813 rng.fill_bytes(&mut buf);
26814 let mut unstructured = Unstructured::new(&buf);
26815 Self::arbitrary(&mut unstructured).unwrap_or_default()
26816 }
26817}
26818impl Default for RC_CHANNELS_RAW_DATA {
26819 fn default() -> Self {
26820 Self::DEFAULT.clone()
26821 }
26822}
26823impl MessageData for RC_CHANNELS_RAW_DATA {
26824 type Message = MavMessage;
26825 const ID: u32 = 35u32;
26826 const NAME: &'static str = "RC_CHANNELS_RAW";
26827 const EXTRA_CRC: u8 = 244u8;
26828 const ENCODED_LEN: usize = 22usize;
26829 fn deser(
26830 _version: MavlinkVersion,
26831 __input: &[u8],
26832 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26833 let avail_len = __input.len();
26834 let mut payload_buf = [0; Self::ENCODED_LEN];
26835 let mut buf = if avail_len < Self::ENCODED_LEN {
26836 payload_buf[0..avail_len].copy_from_slice(__input);
26837 Bytes::new(&payload_buf)
26838 } else {
26839 Bytes::new(__input)
26840 };
26841 let mut __struct = Self::default();
26842 __struct.time_boot_ms = buf.get_u32_le();
26843 __struct.chan1_raw = buf.get_u16_le();
26844 __struct.chan2_raw = buf.get_u16_le();
26845 __struct.chan3_raw = buf.get_u16_le();
26846 __struct.chan4_raw = buf.get_u16_le();
26847 __struct.chan5_raw = buf.get_u16_le();
26848 __struct.chan6_raw = buf.get_u16_le();
26849 __struct.chan7_raw = buf.get_u16_le();
26850 __struct.chan8_raw = buf.get_u16_le();
26851 __struct.port = buf.get_u8();
26852 __struct.rssi = buf.get_u8();
26853 Ok(__struct)
26854 }
26855 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26856 let mut __tmp = BytesMut::new(bytes);
26857 #[allow(clippy::absurd_extreme_comparisons)]
26858 #[allow(unused_comparisons)]
26859 if __tmp.remaining() < Self::ENCODED_LEN {
26860 panic!(
26861 "buffer is too small (need {} bytes, but got {})",
26862 Self::ENCODED_LEN,
26863 __tmp.remaining(),
26864 )
26865 }
26866 __tmp.put_u32_le(self.time_boot_ms);
26867 __tmp.put_u16_le(self.chan1_raw);
26868 __tmp.put_u16_le(self.chan2_raw);
26869 __tmp.put_u16_le(self.chan3_raw);
26870 __tmp.put_u16_le(self.chan4_raw);
26871 __tmp.put_u16_le(self.chan5_raw);
26872 __tmp.put_u16_le(self.chan6_raw);
26873 __tmp.put_u16_le(self.chan7_raw);
26874 __tmp.put_u16_le(self.chan8_raw);
26875 __tmp.put_u8(self.port);
26876 __tmp.put_u8(self.rssi);
26877 if matches!(version, MavlinkVersion::V2) {
26878 let len = __tmp.len();
26879 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26880 } else {
26881 __tmp.len()
26882 }
26883 }
26884}
26885#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
26886#[doc = ""]
26887#[doc = "ID: 34"]
26888#[derive(Debug, Clone, PartialEq)]
26889#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26890#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26891#[cfg_attr(feature = "ts", derive(TS))]
26892#[cfg_attr(feature = "ts", ts(export))]
26893pub struct RC_CHANNELS_SCALED_DATA {
26894 #[doc = "Timestamp (time since system boot)."]
26895 pub time_boot_ms: u32,
26896 #[doc = "RC channel 1 value scaled."]
26897 pub chan1_scaled: i16,
26898 #[doc = "RC channel 2 value scaled."]
26899 pub chan2_scaled: i16,
26900 #[doc = "RC channel 3 value scaled."]
26901 pub chan3_scaled: i16,
26902 #[doc = "RC channel 4 value scaled."]
26903 pub chan4_scaled: i16,
26904 #[doc = "RC channel 5 value scaled."]
26905 pub chan5_scaled: i16,
26906 #[doc = "RC channel 6 value scaled."]
26907 pub chan6_scaled: i16,
26908 #[doc = "RC channel 7 value scaled."]
26909 pub chan7_scaled: i16,
26910 #[doc = "RC channel 8 value scaled."]
26911 pub chan8_scaled: i16,
26912 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26913 pub port: u8,
26914 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26915 pub rssi: u8,
26916}
26917impl RC_CHANNELS_SCALED_DATA {
26918 pub const ENCODED_LEN: usize = 22usize;
26919 pub const DEFAULT: Self = Self {
26920 time_boot_ms: 0_u32,
26921 chan1_scaled: 0_i16,
26922 chan2_scaled: 0_i16,
26923 chan3_scaled: 0_i16,
26924 chan4_scaled: 0_i16,
26925 chan5_scaled: 0_i16,
26926 chan6_scaled: 0_i16,
26927 chan7_scaled: 0_i16,
26928 chan8_scaled: 0_i16,
26929 port: 0_u8,
26930 rssi: 0_u8,
26931 };
26932 #[cfg(feature = "arbitrary")]
26933 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26934 use arbitrary::{Arbitrary, Unstructured};
26935 let mut buf = [0u8; 1024];
26936 rng.fill_bytes(&mut buf);
26937 let mut unstructured = Unstructured::new(&buf);
26938 Self::arbitrary(&mut unstructured).unwrap_or_default()
26939 }
26940}
26941impl Default for RC_CHANNELS_SCALED_DATA {
26942 fn default() -> Self {
26943 Self::DEFAULT.clone()
26944 }
26945}
26946impl MessageData for RC_CHANNELS_SCALED_DATA {
26947 type Message = MavMessage;
26948 const ID: u32 = 34u32;
26949 const NAME: &'static str = "RC_CHANNELS_SCALED";
26950 const EXTRA_CRC: u8 = 237u8;
26951 const ENCODED_LEN: usize = 22usize;
26952 fn deser(
26953 _version: MavlinkVersion,
26954 __input: &[u8],
26955 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26956 let avail_len = __input.len();
26957 let mut payload_buf = [0; Self::ENCODED_LEN];
26958 let mut buf = if avail_len < Self::ENCODED_LEN {
26959 payload_buf[0..avail_len].copy_from_slice(__input);
26960 Bytes::new(&payload_buf)
26961 } else {
26962 Bytes::new(__input)
26963 };
26964 let mut __struct = Self::default();
26965 __struct.time_boot_ms = buf.get_u32_le();
26966 __struct.chan1_scaled = buf.get_i16_le();
26967 __struct.chan2_scaled = buf.get_i16_le();
26968 __struct.chan3_scaled = buf.get_i16_le();
26969 __struct.chan4_scaled = buf.get_i16_le();
26970 __struct.chan5_scaled = buf.get_i16_le();
26971 __struct.chan6_scaled = buf.get_i16_le();
26972 __struct.chan7_scaled = buf.get_i16_le();
26973 __struct.chan8_scaled = buf.get_i16_le();
26974 __struct.port = buf.get_u8();
26975 __struct.rssi = buf.get_u8();
26976 Ok(__struct)
26977 }
26978 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26979 let mut __tmp = BytesMut::new(bytes);
26980 #[allow(clippy::absurd_extreme_comparisons)]
26981 #[allow(unused_comparisons)]
26982 if __tmp.remaining() < Self::ENCODED_LEN {
26983 panic!(
26984 "buffer is too small (need {} bytes, but got {})",
26985 Self::ENCODED_LEN,
26986 __tmp.remaining(),
26987 )
26988 }
26989 __tmp.put_u32_le(self.time_boot_ms);
26990 __tmp.put_i16_le(self.chan1_scaled);
26991 __tmp.put_i16_le(self.chan2_scaled);
26992 __tmp.put_i16_le(self.chan3_scaled);
26993 __tmp.put_i16_le(self.chan4_scaled);
26994 __tmp.put_i16_le(self.chan5_scaled);
26995 __tmp.put_i16_le(self.chan6_scaled);
26996 __tmp.put_i16_le(self.chan7_scaled);
26997 __tmp.put_i16_le(self.chan8_scaled);
26998 __tmp.put_u8(self.port);
26999 __tmp.put_u8(self.rssi);
27000 if matches!(version, MavlinkVersion::V2) {
27001 let len = __tmp.len();
27002 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27003 } else {
27004 __tmp.len()
27005 }
27006 }
27007}
27008#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
27009#[doc = "Request a data stream."]
27010#[doc = ""]
27011#[doc = "ID: 66"]
27012#[derive(Debug, Clone, PartialEq)]
27013#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27014#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27015#[cfg_attr(feature = "ts", derive(TS))]
27016#[cfg_attr(feature = "ts", ts(export))]
27017pub struct REQUEST_DATA_STREAM_DATA {
27018 #[doc = "The requested message rate"]
27019 pub req_message_rate: u16,
27020 #[doc = "The target requested to send the message stream."]
27021 pub target_system: u8,
27022 #[doc = "The target requested to send the message stream."]
27023 pub target_component: u8,
27024 #[doc = "The ID of the requested data stream"]
27025 pub req_stream_id: u8,
27026 #[doc = "1 to start sending, 0 to stop sending."]
27027 pub start_stop: u8,
27028}
27029impl REQUEST_DATA_STREAM_DATA {
27030 pub const ENCODED_LEN: usize = 6usize;
27031 pub const DEFAULT: Self = Self {
27032 req_message_rate: 0_u16,
27033 target_system: 0_u8,
27034 target_component: 0_u8,
27035 req_stream_id: 0_u8,
27036 start_stop: 0_u8,
27037 };
27038 #[cfg(feature = "arbitrary")]
27039 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27040 use arbitrary::{Arbitrary, Unstructured};
27041 let mut buf = [0u8; 1024];
27042 rng.fill_bytes(&mut buf);
27043 let mut unstructured = Unstructured::new(&buf);
27044 Self::arbitrary(&mut unstructured).unwrap_or_default()
27045 }
27046}
27047impl Default for REQUEST_DATA_STREAM_DATA {
27048 fn default() -> Self {
27049 Self::DEFAULT.clone()
27050 }
27051}
27052impl MessageData for REQUEST_DATA_STREAM_DATA {
27053 type Message = MavMessage;
27054 const ID: u32 = 66u32;
27055 const NAME: &'static str = "REQUEST_DATA_STREAM";
27056 const EXTRA_CRC: u8 = 148u8;
27057 const ENCODED_LEN: usize = 6usize;
27058 fn deser(
27059 _version: MavlinkVersion,
27060 __input: &[u8],
27061 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27062 let avail_len = __input.len();
27063 let mut payload_buf = [0; Self::ENCODED_LEN];
27064 let mut buf = if avail_len < Self::ENCODED_LEN {
27065 payload_buf[0..avail_len].copy_from_slice(__input);
27066 Bytes::new(&payload_buf)
27067 } else {
27068 Bytes::new(__input)
27069 };
27070 let mut __struct = Self::default();
27071 __struct.req_message_rate = buf.get_u16_le();
27072 __struct.target_system = buf.get_u8();
27073 __struct.target_component = buf.get_u8();
27074 __struct.req_stream_id = buf.get_u8();
27075 __struct.start_stop = buf.get_u8();
27076 Ok(__struct)
27077 }
27078 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27079 let mut __tmp = BytesMut::new(bytes);
27080 #[allow(clippy::absurd_extreme_comparisons)]
27081 #[allow(unused_comparisons)]
27082 if __tmp.remaining() < Self::ENCODED_LEN {
27083 panic!(
27084 "buffer is too small (need {} bytes, but got {})",
27085 Self::ENCODED_LEN,
27086 __tmp.remaining(),
27087 )
27088 }
27089 __tmp.put_u16_le(self.req_message_rate);
27090 __tmp.put_u8(self.target_system);
27091 __tmp.put_u8(self.target_component);
27092 __tmp.put_u8(self.req_stream_id);
27093 __tmp.put_u8(self.start_stop);
27094 if matches!(version, MavlinkVersion::V2) {
27095 let len = __tmp.len();
27096 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27097 } else {
27098 __tmp.len()
27099 }
27100 }
27101}
27102#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
27103#[doc = ""]
27104#[doc = "ID: 412"]
27105#[derive(Debug, Clone, PartialEq)]
27106#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27107#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27108#[cfg_attr(feature = "ts", derive(TS))]
27109#[cfg_attr(feature = "ts", ts(export))]
27110pub struct REQUEST_EVENT_DATA {
27111 #[doc = "First sequence number of the requested event."]
27112 pub first_sequence: u16,
27113 #[doc = "Last sequence number of the requested event."]
27114 pub last_sequence: u16,
27115 #[doc = "System ID"]
27116 pub target_system: u8,
27117 #[doc = "Component ID"]
27118 pub target_component: u8,
27119}
27120impl REQUEST_EVENT_DATA {
27121 pub const ENCODED_LEN: usize = 6usize;
27122 pub const DEFAULT: Self = Self {
27123 first_sequence: 0_u16,
27124 last_sequence: 0_u16,
27125 target_system: 0_u8,
27126 target_component: 0_u8,
27127 };
27128 #[cfg(feature = "arbitrary")]
27129 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27130 use arbitrary::{Arbitrary, Unstructured};
27131 let mut buf = [0u8; 1024];
27132 rng.fill_bytes(&mut buf);
27133 let mut unstructured = Unstructured::new(&buf);
27134 Self::arbitrary(&mut unstructured).unwrap_or_default()
27135 }
27136}
27137impl Default for REQUEST_EVENT_DATA {
27138 fn default() -> Self {
27139 Self::DEFAULT.clone()
27140 }
27141}
27142impl MessageData for REQUEST_EVENT_DATA {
27143 type Message = MavMessage;
27144 const ID: u32 = 412u32;
27145 const NAME: &'static str = "REQUEST_EVENT";
27146 const EXTRA_CRC: u8 = 33u8;
27147 const ENCODED_LEN: usize = 6usize;
27148 fn deser(
27149 _version: MavlinkVersion,
27150 __input: &[u8],
27151 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27152 let avail_len = __input.len();
27153 let mut payload_buf = [0; Self::ENCODED_LEN];
27154 let mut buf = if avail_len < Self::ENCODED_LEN {
27155 payload_buf[0..avail_len].copy_from_slice(__input);
27156 Bytes::new(&payload_buf)
27157 } else {
27158 Bytes::new(__input)
27159 };
27160 let mut __struct = Self::default();
27161 __struct.first_sequence = buf.get_u16_le();
27162 __struct.last_sequence = buf.get_u16_le();
27163 __struct.target_system = buf.get_u8();
27164 __struct.target_component = buf.get_u8();
27165 Ok(__struct)
27166 }
27167 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27168 let mut __tmp = BytesMut::new(bytes);
27169 #[allow(clippy::absurd_extreme_comparisons)]
27170 #[allow(unused_comparisons)]
27171 if __tmp.remaining() < Self::ENCODED_LEN {
27172 panic!(
27173 "buffer is too small (need {} bytes, but got {})",
27174 Self::ENCODED_LEN,
27175 __tmp.remaining(),
27176 )
27177 }
27178 __tmp.put_u16_le(self.first_sequence);
27179 __tmp.put_u16_le(self.last_sequence);
27180 __tmp.put_u8(self.target_system);
27181 __tmp.put_u8(self.target_component);
27182 if matches!(version, MavlinkVersion::V2) {
27183 let len = __tmp.len();
27184 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27185 } else {
27186 __tmp.len()
27187 }
27188 }
27189}
27190#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
27191#[doc = ""]
27192#[doc = "ID: 142"]
27193#[derive(Debug, Clone, PartialEq)]
27194#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27195#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27196#[cfg_attr(feature = "ts", derive(TS))]
27197#[cfg_attr(feature = "ts", ts(export))]
27198pub struct RESOURCE_REQUEST_DATA {
27199 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
27200 pub request_id: u8,
27201 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
27202 pub uri_type: u8,
27203 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
27204 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27205 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27206 pub uri: [u8; 120],
27207 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
27208 pub transfer_type: u8,
27209 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
27210 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27211 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27212 pub storage: [u8; 120],
27213}
27214impl RESOURCE_REQUEST_DATA {
27215 pub const ENCODED_LEN: usize = 243usize;
27216 pub const DEFAULT: Self = Self {
27217 request_id: 0_u8,
27218 uri_type: 0_u8,
27219 uri: [0_u8; 120usize],
27220 transfer_type: 0_u8,
27221 storage: [0_u8; 120usize],
27222 };
27223 #[cfg(feature = "arbitrary")]
27224 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27225 use arbitrary::{Arbitrary, Unstructured};
27226 let mut buf = [0u8; 1024];
27227 rng.fill_bytes(&mut buf);
27228 let mut unstructured = Unstructured::new(&buf);
27229 Self::arbitrary(&mut unstructured).unwrap_or_default()
27230 }
27231}
27232impl Default for RESOURCE_REQUEST_DATA {
27233 fn default() -> Self {
27234 Self::DEFAULT.clone()
27235 }
27236}
27237impl MessageData for RESOURCE_REQUEST_DATA {
27238 type Message = MavMessage;
27239 const ID: u32 = 142u32;
27240 const NAME: &'static str = "RESOURCE_REQUEST";
27241 const EXTRA_CRC: u8 = 72u8;
27242 const ENCODED_LEN: usize = 243usize;
27243 fn deser(
27244 _version: MavlinkVersion,
27245 __input: &[u8],
27246 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27247 let avail_len = __input.len();
27248 let mut payload_buf = [0; Self::ENCODED_LEN];
27249 let mut buf = if avail_len < Self::ENCODED_LEN {
27250 payload_buf[0..avail_len].copy_from_slice(__input);
27251 Bytes::new(&payload_buf)
27252 } else {
27253 Bytes::new(__input)
27254 };
27255 let mut __struct = Self::default();
27256 __struct.request_id = buf.get_u8();
27257 __struct.uri_type = buf.get_u8();
27258 for v in &mut __struct.uri {
27259 let val = buf.get_u8();
27260 *v = val;
27261 }
27262 __struct.transfer_type = buf.get_u8();
27263 for v in &mut __struct.storage {
27264 let val = buf.get_u8();
27265 *v = val;
27266 }
27267 Ok(__struct)
27268 }
27269 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27270 let mut __tmp = BytesMut::new(bytes);
27271 #[allow(clippy::absurd_extreme_comparisons)]
27272 #[allow(unused_comparisons)]
27273 if __tmp.remaining() < Self::ENCODED_LEN {
27274 panic!(
27275 "buffer is too small (need {} bytes, but got {})",
27276 Self::ENCODED_LEN,
27277 __tmp.remaining(),
27278 )
27279 }
27280 __tmp.put_u8(self.request_id);
27281 __tmp.put_u8(self.uri_type);
27282 for val in &self.uri {
27283 __tmp.put_u8(*val);
27284 }
27285 __tmp.put_u8(self.transfer_type);
27286 for val in &self.storage {
27287 __tmp.put_u8(*val);
27288 }
27289 if matches!(version, MavlinkVersion::V2) {
27290 let len = __tmp.len();
27291 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27292 } else {
27293 __tmp.len()
27294 }
27295 }
27296}
27297#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
27298#[doc = ""]
27299#[doc = "ID: 413"]
27300#[derive(Debug, Clone, PartialEq)]
27301#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27302#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27303#[cfg_attr(feature = "ts", derive(TS))]
27304#[cfg_attr(feature = "ts", ts(export))]
27305pub struct RESPONSE_EVENT_ERROR_DATA {
27306 #[doc = "Sequence number."]
27307 pub sequence: u16,
27308 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
27309 pub sequence_oldest_available: u16,
27310 #[doc = "System ID"]
27311 pub target_system: u8,
27312 #[doc = "Component ID"]
27313 pub target_component: u8,
27314 #[doc = "Error reason."]
27315 pub reason: MavEventErrorReason,
27316}
27317impl RESPONSE_EVENT_ERROR_DATA {
27318 pub const ENCODED_LEN: usize = 7usize;
27319 pub const DEFAULT: Self = Self {
27320 sequence: 0_u16,
27321 sequence_oldest_available: 0_u16,
27322 target_system: 0_u8,
27323 target_component: 0_u8,
27324 reason: MavEventErrorReason::DEFAULT,
27325 };
27326 #[cfg(feature = "arbitrary")]
27327 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27328 use arbitrary::{Arbitrary, Unstructured};
27329 let mut buf = [0u8; 1024];
27330 rng.fill_bytes(&mut buf);
27331 let mut unstructured = Unstructured::new(&buf);
27332 Self::arbitrary(&mut unstructured).unwrap_or_default()
27333 }
27334}
27335impl Default for RESPONSE_EVENT_ERROR_DATA {
27336 fn default() -> Self {
27337 Self::DEFAULT.clone()
27338 }
27339}
27340impl MessageData for RESPONSE_EVENT_ERROR_DATA {
27341 type Message = MavMessage;
27342 const ID: u32 = 413u32;
27343 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
27344 const EXTRA_CRC: u8 = 77u8;
27345 const ENCODED_LEN: usize = 7usize;
27346 fn deser(
27347 _version: MavlinkVersion,
27348 __input: &[u8],
27349 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27350 let avail_len = __input.len();
27351 let mut payload_buf = [0; Self::ENCODED_LEN];
27352 let mut buf = if avail_len < Self::ENCODED_LEN {
27353 payload_buf[0..avail_len].copy_from_slice(__input);
27354 Bytes::new(&payload_buf)
27355 } else {
27356 Bytes::new(__input)
27357 };
27358 let mut __struct = Self::default();
27359 __struct.sequence = buf.get_u16_le();
27360 __struct.sequence_oldest_available = buf.get_u16_le();
27361 __struct.target_system = buf.get_u8();
27362 __struct.target_component = buf.get_u8();
27363 let tmp = buf.get_u8();
27364 __struct.reason =
27365 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27366 enum_type: "MavEventErrorReason",
27367 value: tmp as u32,
27368 })?;
27369 Ok(__struct)
27370 }
27371 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27372 let mut __tmp = BytesMut::new(bytes);
27373 #[allow(clippy::absurd_extreme_comparisons)]
27374 #[allow(unused_comparisons)]
27375 if __tmp.remaining() < Self::ENCODED_LEN {
27376 panic!(
27377 "buffer is too small (need {} bytes, but got {})",
27378 Self::ENCODED_LEN,
27379 __tmp.remaining(),
27380 )
27381 }
27382 __tmp.put_u16_le(self.sequence);
27383 __tmp.put_u16_le(self.sequence_oldest_available);
27384 __tmp.put_u8(self.target_system);
27385 __tmp.put_u8(self.target_component);
27386 __tmp.put_u8(self.reason as u8);
27387 if matches!(version, MavlinkVersion::V2) {
27388 let len = __tmp.len();
27389 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27390 } else {
27391 __tmp.len()
27392 }
27393 }
27394}
27395#[doc = "Read out the safety zone the MAV currently assumes."]
27396#[doc = ""]
27397#[doc = "ID: 55"]
27398#[derive(Debug, Clone, PartialEq)]
27399#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27400#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27401#[cfg_attr(feature = "ts", derive(TS))]
27402#[cfg_attr(feature = "ts", ts(export))]
27403pub struct SAFETY_ALLOWED_AREA_DATA {
27404 #[doc = "x position 1 / Latitude 1"]
27405 pub p1x: f32,
27406 #[doc = "y position 1 / Longitude 1"]
27407 pub p1y: f32,
27408 #[doc = "z position 1 / Altitude 1"]
27409 pub p1z: f32,
27410 #[doc = "x position 2 / Latitude 2"]
27411 pub p2x: f32,
27412 #[doc = "y position 2 / Longitude 2"]
27413 pub p2y: f32,
27414 #[doc = "z position 2 / Altitude 2"]
27415 pub p2z: f32,
27416 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
27417 pub frame: MavFrame,
27418}
27419impl SAFETY_ALLOWED_AREA_DATA {
27420 pub const ENCODED_LEN: usize = 25usize;
27421 pub const DEFAULT: Self = Self {
27422 p1x: 0.0_f32,
27423 p1y: 0.0_f32,
27424 p1z: 0.0_f32,
27425 p2x: 0.0_f32,
27426 p2y: 0.0_f32,
27427 p2z: 0.0_f32,
27428 frame: MavFrame::DEFAULT,
27429 };
27430 #[cfg(feature = "arbitrary")]
27431 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27432 use arbitrary::{Arbitrary, Unstructured};
27433 let mut buf = [0u8; 1024];
27434 rng.fill_bytes(&mut buf);
27435 let mut unstructured = Unstructured::new(&buf);
27436 Self::arbitrary(&mut unstructured).unwrap_or_default()
27437 }
27438}
27439impl Default for SAFETY_ALLOWED_AREA_DATA {
27440 fn default() -> Self {
27441 Self::DEFAULT.clone()
27442 }
27443}
27444impl MessageData for SAFETY_ALLOWED_AREA_DATA {
27445 type Message = MavMessage;
27446 const ID: u32 = 55u32;
27447 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
27448 const EXTRA_CRC: u8 = 3u8;
27449 const ENCODED_LEN: usize = 25usize;
27450 fn deser(
27451 _version: MavlinkVersion,
27452 __input: &[u8],
27453 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27454 let avail_len = __input.len();
27455 let mut payload_buf = [0; Self::ENCODED_LEN];
27456 let mut buf = if avail_len < Self::ENCODED_LEN {
27457 payload_buf[0..avail_len].copy_from_slice(__input);
27458 Bytes::new(&payload_buf)
27459 } else {
27460 Bytes::new(__input)
27461 };
27462 let mut __struct = Self::default();
27463 __struct.p1x = buf.get_f32_le();
27464 __struct.p1y = buf.get_f32_le();
27465 __struct.p1z = buf.get_f32_le();
27466 __struct.p2x = buf.get_f32_le();
27467 __struct.p2y = buf.get_f32_le();
27468 __struct.p2z = buf.get_f32_le();
27469 let tmp = buf.get_u8();
27470 __struct.frame =
27471 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27472 enum_type: "MavFrame",
27473 value: tmp as u32,
27474 })?;
27475 Ok(__struct)
27476 }
27477 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27478 let mut __tmp = BytesMut::new(bytes);
27479 #[allow(clippy::absurd_extreme_comparisons)]
27480 #[allow(unused_comparisons)]
27481 if __tmp.remaining() < Self::ENCODED_LEN {
27482 panic!(
27483 "buffer is too small (need {} bytes, but got {})",
27484 Self::ENCODED_LEN,
27485 __tmp.remaining(),
27486 )
27487 }
27488 __tmp.put_f32_le(self.p1x);
27489 __tmp.put_f32_le(self.p1y);
27490 __tmp.put_f32_le(self.p1z);
27491 __tmp.put_f32_le(self.p2x);
27492 __tmp.put_f32_le(self.p2y);
27493 __tmp.put_f32_le(self.p2z);
27494 __tmp.put_u8(self.frame as u8);
27495 if matches!(version, MavlinkVersion::V2) {
27496 let len = __tmp.len();
27497 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27498 } else {
27499 __tmp.len()
27500 }
27501 }
27502}
27503#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
27504#[doc = ""]
27505#[doc = "ID: 54"]
27506#[derive(Debug, Clone, PartialEq)]
27507#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27509#[cfg_attr(feature = "ts", derive(TS))]
27510#[cfg_attr(feature = "ts", ts(export))]
27511pub struct SAFETY_SET_ALLOWED_AREA_DATA {
27512 #[doc = "x position 1 / Latitude 1"]
27513 pub p1x: f32,
27514 #[doc = "y position 1 / Longitude 1"]
27515 pub p1y: f32,
27516 #[doc = "z position 1 / Altitude 1"]
27517 pub p1z: f32,
27518 #[doc = "x position 2 / Latitude 2"]
27519 pub p2x: f32,
27520 #[doc = "y position 2 / Longitude 2"]
27521 pub p2y: f32,
27522 #[doc = "z position 2 / Altitude 2"]
27523 pub p2z: f32,
27524 #[doc = "System ID"]
27525 pub target_system: u8,
27526 #[doc = "Component ID"]
27527 pub target_component: u8,
27528 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
27529 pub frame: MavFrame,
27530}
27531impl SAFETY_SET_ALLOWED_AREA_DATA {
27532 pub const ENCODED_LEN: usize = 27usize;
27533 pub const DEFAULT: Self = Self {
27534 p1x: 0.0_f32,
27535 p1y: 0.0_f32,
27536 p1z: 0.0_f32,
27537 p2x: 0.0_f32,
27538 p2y: 0.0_f32,
27539 p2z: 0.0_f32,
27540 target_system: 0_u8,
27541 target_component: 0_u8,
27542 frame: MavFrame::DEFAULT,
27543 };
27544 #[cfg(feature = "arbitrary")]
27545 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27546 use arbitrary::{Arbitrary, Unstructured};
27547 let mut buf = [0u8; 1024];
27548 rng.fill_bytes(&mut buf);
27549 let mut unstructured = Unstructured::new(&buf);
27550 Self::arbitrary(&mut unstructured).unwrap_or_default()
27551 }
27552}
27553impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
27554 fn default() -> Self {
27555 Self::DEFAULT.clone()
27556 }
27557}
27558impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
27559 type Message = MavMessage;
27560 const ID: u32 = 54u32;
27561 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
27562 const EXTRA_CRC: u8 = 15u8;
27563 const ENCODED_LEN: usize = 27usize;
27564 fn deser(
27565 _version: MavlinkVersion,
27566 __input: &[u8],
27567 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27568 let avail_len = __input.len();
27569 let mut payload_buf = [0; Self::ENCODED_LEN];
27570 let mut buf = if avail_len < Self::ENCODED_LEN {
27571 payload_buf[0..avail_len].copy_from_slice(__input);
27572 Bytes::new(&payload_buf)
27573 } else {
27574 Bytes::new(__input)
27575 };
27576 let mut __struct = Self::default();
27577 __struct.p1x = buf.get_f32_le();
27578 __struct.p1y = buf.get_f32_le();
27579 __struct.p1z = buf.get_f32_le();
27580 __struct.p2x = buf.get_f32_le();
27581 __struct.p2y = buf.get_f32_le();
27582 __struct.p2z = buf.get_f32_le();
27583 __struct.target_system = buf.get_u8();
27584 __struct.target_component = buf.get_u8();
27585 let tmp = buf.get_u8();
27586 __struct.frame =
27587 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27588 enum_type: "MavFrame",
27589 value: tmp as u32,
27590 })?;
27591 Ok(__struct)
27592 }
27593 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27594 let mut __tmp = BytesMut::new(bytes);
27595 #[allow(clippy::absurd_extreme_comparisons)]
27596 #[allow(unused_comparisons)]
27597 if __tmp.remaining() < Self::ENCODED_LEN {
27598 panic!(
27599 "buffer is too small (need {} bytes, but got {})",
27600 Self::ENCODED_LEN,
27601 __tmp.remaining(),
27602 )
27603 }
27604 __tmp.put_f32_le(self.p1x);
27605 __tmp.put_f32_le(self.p1y);
27606 __tmp.put_f32_le(self.p1z);
27607 __tmp.put_f32_le(self.p2x);
27608 __tmp.put_f32_le(self.p2y);
27609 __tmp.put_f32_le(self.p2z);
27610 __tmp.put_u8(self.target_system);
27611 __tmp.put_u8(self.target_component);
27612 __tmp.put_u8(self.frame as u8);
27613 if matches!(version, MavlinkVersion::V2) {
27614 let len = __tmp.len();
27615 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27616 } else {
27617 __tmp.len()
27618 }
27619 }
27620}
27621#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
27622#[doc = ""]
27623#[doc = "ID: 26"]
27624#[derive(Debug, Clone, PartialEq)]
27625#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27626#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27627#[cfg_attr(feature = "ts", derive(TS))]
27628#[cfg_attr(feature = "ts", ts(export))]
27629pub struct SCALED_IMU_DATA {
27630 #[doc = "Timestamp (time since system boot)."]
27631 pub time_boot_ms: u32,
27632 #[doc = "X acceleration"]
27633 pub xacc: i16,
27634 #[doc = "Y acceleration"]
27635 pub yacc: i16,
27636 #[doc = "Z acceleration"]
27637 pub zacc: i16,
27638 #[doc = "Angular speed around X axis"]
27639 pub xgyro: i16,
27640 #[doc = "Angular speed around Y axis"]
27641 pub ygyro: i16,
27642 #[doc = "Angular speed around Z axis"]
27643 pub zgyro: i16,
27644 #[doc = "X Magnetic field"]
27645 pub xmag: i16,
27646 #[doc = "Y Magnetic field"]
27647 pub ymag: i16,
27648 #[doc = "Z Magnetic field"]
27649 pub zmag: i16,
27650 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27651 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27652 pub temperature: i16,
27653}
27654impl SCALED_IMU_DATA {
27655 pub const ENCODED_LEN: usize = 24usize;
27656 pub const DEFAULT: Self = Self {
27657 time_boot_ms: 0_u32,
27658 xacc: 0_i16,
27659 yacc: 0_i16,
27660 zacc: 0_i16,
27661 xgyro: 0_i16,
27662 ygyro: 0_i16,
27663 zgyro: 0_i16,
27664 xmag: 0_i16,
27665 ymag: 0_i16,
27666 zmag: 0_i16,
27667 temperature: 0_i16,
27668 };
27669 #[cfg(feature = "arbitrary")]
27670 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27671 use arbitrary::{Arbitrary, Unstructured};
27672 let mut buf = [0u8; 1024];
27673 rng.fill_bytes(&mut buf);
27674 let mut unstructured = Unstructured::new(&buf);
27675 Self::arbitrary(&mut unstructured).unwrap_or_default()
27676 }
27677}
27678impl Default for SCALED_IMU_DATA {
27679 fn default() -> Self {
27680 Self::DEFAULT.clone()
27681 }
27682}
27683impl MessageData for SCALED_IMU_DATA {
27684 type Message = MavMessage;
27685 const ID: u32 = 26u32;
27686 const NAME: &'static str = "SCALED_IMU";
27687 const EXTRA_CRC: u8 = 170u8;
27688 const ENCODED_LEN: usize = 24usize;
27689 fn deser(
27690 _version: MavlinkVersion,
27691 __input: &[u8],
27692 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27693 let avail_len = __input.len();
27694 let mut payload_buf = [0; Self::ENCODED_LEN];
27695 let mut buf = if avail_len < Self::ENCODED_LEN {
27696 payload_buf[0..avail_len].copy_from_slice(__input);
27697 Bytes::new(&payload_buf)
27698 } else {
27699 Bytes::new(__input)
27700 };
27701 let mut __struct = Self::default();
27702 __struct.time_boot_ms = buf.get_u32_le();
27703 __struct.xacc = buf.get_i16_le();
27704 __struct.yacc = buf.get_i16_le();
27705 __struct.zacc = buf.get_i16_le();
27706 __struct.xgyro = buf.get_i16_le();
27707 __struct.ygyro = buf.get_i16_le();
27708 __struct.zgyro = buf.get_i16_le();
27709 __struct.xmag = buf.get_i16_le();
27710 __struct.ymag = buf.get_i16_le();
27711 __struct.zmag = buf.get_i16_le();
27712 __struct.temperature = buf.get_i16_le();
27713 Ok(__struct)
27714 }
27715 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27716 let mut __tmp = BytesMut::new(bytes);
27717 #[allow(clippy::absurd_extreme_comparisons)]
27718 #[allow(unused_comparisons)]
27719 if __tmp.remaining() < Self::ENCODED_LEN {
27720 panic!(
27721 "buffer is too small (need {} bytes, but got {})",
27722 Self::ENCODED_LEN,
27723 __tmp.remaining(),
27724 )
27725 }
27726 __tmp.put_u32_le(self.time_boot_ms);
27727 __tmp.put_i16_le(self.xacc);
27728 __tmp.put_i16_le(self.yacc);
27729 __tmp.put_i16_le(self.zacc);
27730 __tmp.put_i16_le(self.xgyro);
27731 __tmp.put_i16_le(self.ygyro);
27732 __tmp.put_i16_le(self.zgyro);
27733 __tmp.put_i16_le(self.xmag);
27734 __tmp.put_i16_le(self.ymag);
27735 __tmp.put_i16_le(self.zmag);
27736 if matches!(version, MavlinkVersion::V2) {
27737 __tmp.put_i16_le(self.temperature);
27738 let len = __tmp.len();
27739 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27740 } else {
27741 __tmp.len()
27742 }
27743 }
27744}
27745#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
27746#[doc = ""]
27747#[doc = "ID: 116"]
27748#[derive(Debug, Clone, PartialEq)]
27749#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27750#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27751#[cfg_attr(feature = "ts", derive(TS))]
27752#[cfg_attr(feature = "ts", ts(export))]
27753pub struct SCALED_IMU2_DATA {
27754 #[doc = "Timestamp (time since system boot)."]
27755 pub time_boot_ms: u32,
27756 #[doc = "X acceleration"]
27757 pub xacc: i16,
27758 #[doc = "Y acceleration"]
27759 pub yacc: i16,
27760 #[doc = "Z acceleration"]
27761 pub zacc: i16,
27762 #[doc = "Angular speed around X axis"]
27763 pub xgyro: i16,
27764 #[doc = "Angular speed around Y axis"]
27765 pub ygyro: i16,
27766 #[doc = "Angular speed around Z axis"]
27767 pub zgyro: i16,
27768 #[doc = "X Magnetic field"]
27769 pub xmag: i16,
27770 #[doc = "Y Magnetic field"]
27771 pub ymag: i16,
27772 #[doc = "Z Magnetic field"]
27773 pub zmag: i16,
27774 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27775 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27776 pub temperature: i16,
27777}
27778impl SCALED_IMU2_DATA {
27779 pub const ENCODED_LEN: usize = 24usize;
27780 pub const DEFAULT: Self = Self {
27781 time_boot_ms: 0_u32,
27782 xacc: 0_i16,
27783 yacc: 0_i16,
27784 zacc: 0_i16,
27785 xgyro: 0_i16,
27786 ygyro: 0_i16,
27787 zgyro: 0_i16,
27788 xmag: 0_i16,
27789 ymag: 0_i16,
27790 zmag: 0_i16,
27791 temperature: 0_i16,
27792 };
27793 #[cfg(feature = "arbitrary")]
27794 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27795 use arbitrary::{Arbitrary, Unstructured};
27796 let mut buf = [0u8; 1024];
27797 rng.fill_bytes(&mut buf);
27798 let mut unstructured = Unstructured::new(&buf);
27799 Self::arbitrary(&mut unstructured).unwrap_or_default()
27800 }
27801}
27802impl Default for SCALED_IMU2_DATA {
27803 fn default() -> Self {
27804 Self::DEFAULT.clone()
27805 }
27806}
27807impl MessageData for SCALED_IMU2_DATA {
27808 type Message = MavMessage;
27809 const ID: u32 = 116u32;
27810 const NAME: &'static str = "SCALED_IMU2";
27811 const EXTRA_CRC: u8 = 76u8;
27812 const ENCODED_LEN: usize = 24usize;
27813 fn deser(
27814 _version: MavlinkVersion,
27815 __input: &[u8],
27816 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27817 let avail_len = __input.len();
27818 let mut payload_buf = [0; Self::ENCODED_LEN];
27819 let mut buf = if avail_len < Self::ENCODED_LEN {
27820 payload_buf[0..avail_len].copy_from_slice(__input);
27821 Bytes::new(&payload_buf)
27822 } else {
27823 Bytes::new(__input)
27824 };
27825 let mut __struct = Self::default();
27826 __struct.time_boot_ms = buf.get_u32_le();
27827 __struct.xacc = buf.get_i16_le();
27828 __struct.yacc = buf.get_i16_le();
27829 __struct.zacc = buf.get_i16_le();
27830 __struct.xgyro = buf.get_i16_le();
27831 __struct.ygyro = buf.get_i16_le();
27832 __struct.zgyro = buf.get_i16_le();
27833 __struct.xmag = buf.get_i16_le();
27834 __struct.ymag = buf.get_i16_le();
27835 __struct.zmag = buf.get_i16_le();
27836 __struct.temperature = buf.get_i16_le();
27837 Ok(__struct)
27838 }
27839 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27840 let mut __tmp = BytesMut::new(bytes);
27841 #[allow(clippy::absurd_extreme_comparisons)]
27842 #[allow(unused_comparisons)]
27843 if __tmp.remaining() < Self::ENCODED_LEN {
27844 panic!(
27845 "buffer is too small (need {} bytes, but got {})",
27846 Self::ENCODED_LEN,
27847 __tmp.remaining(),
27848 )
27849 }
27850 __tmp.put_u32_le(self.time_boot_ms);
27851 __tmp.put_i16_le(self.xacc);
27852 __tmp.put_i16_le(self.yacc);
27853 __tmp.put_i16_le(self.zacc);
27854 __tmp.put_i16_le(self.xgyro);
27855 __tmp.put_i16_le(self.ygyro);
27856 __tmp.put_i16_le(self.zgyro);
27857 __tmp.put_i16_le(self.xmag);
27858 __tmp.put_i16_le(self.ymag);
27859 __tmp.put_i16_le(self.zmag);
27860 if matches!(version, MavlinkVersion::V2) {
27861 __tmp.put_i16_le(self.temperature);
27862 let len = __tmp.len();
27863 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27864 } else {
27865 __tmp.len()
27866 }
27867 }
27868}
27869#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
27870#[doc = ""]
27871#[doc = "ID: 129"]
27872#[derive(Debug, Clone, PartialEq)]
27873#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27874#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27875#[cfg_attr(feature = "ts", derive(TS))]
27876#[cfg_attr(feature = "ts", ts(export))]
27877pub struct SCALED_IMU3_DATA {
27878 #[doc = "Timestamp (time since system boot)."]
27879 pub time_boot_ms: u32,
27880 #[doc = "X acceleration"]
27881 pub xacc: i16,
27882 #[doc = "Y acceleration"]
27883 pub yacc: i16,
27884 #[doc = "Z acceleration"]
27885 pub zacc: i16,
27886 #[doc = "Angular speed around X axis"]
27887 pub xgyro: i16,
27888 #[doc = "Angular speed around Y axis"]
27889 pub ygyro: i16,
27890 #[doc = "Angular speed around Z axis"]
27891 pub zgyro: i16,
27892 #[doc = "X Magnetic field"]
27893 pub xmag: i16,
27894 #[doc = "Y Magnetic field"]
27895 pub ymag: i16,
27896 #[doc = "Z Magnetic field"]
27897 pub zmag: i16,
27898 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27899 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27900 pub temperature: i16,
27901}
27902impl SCALED_IMU3_DATA {
27903 pub const ENCODED_LEN: usize = 24usize;
27904 pub const DEFAULT: Self = Self {
27905 time_boot_ms: 0_u32,
27906 xacc: 0_i16,
27907 yacc: 0_i16,
27908 zacc: 0_i16,
27909 xgyro: 0_i16,
27910 ygyro: 0_i16,
27911 zgyro: 0_i16,
27912 xmag: 0_i16,
27913 ymag: 0_i16,
27914 zmag: 0_i16,
27915 temperature: 0_i16,
27916 };
27917 #[cfg(feature = "arbitrary")]
27918 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27919 use arbitrary::{Arbitrary, Unstructured};
27920 let mut buf = [0u8; 1024];
27921 rng.fill_bytes(&mut buf);
27922 let mut unstructured = Unstructured::new(&buf);
27923 Self::arbitrary(&mut unstructured).unwrap_or_default()
27924 }
27925}
27926impl Default for SCALED_IMU3_DATA {
27927 fn default() -> Self {
27928 Self::DEFAULT.clone()
27929 }
27930}
27931impl MessageData for SCALED_IMU3_DATA {
27932 type Message = MavMessage;
27933 const ID: u32 = 129u32;
27934 const NAME: &'static str = "SCALED_IMU3";
27935 const EXTRA_CRC: u8 = 46u8;
27936 const ENCODED_LEN: usize = 24usize;
27937 fn deser(
27938 _version: MavlinkVersion,
27939 __input: &[u8],
27940 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27941 let avail_len = __input.len();
27942 let mut payload_buf = [0; Self::ENCODED_LEN];
27943 let mut buf = if avail_len < Self::ENCODED_LEN {
27944 payload_buf[0..avail_len].copy_from_slice(__input);
27945 Bytes::new(&payload_buf)
27946 } else {
27947 Bytes::new(__input)
27948 };
27949 let mut __struct = Self::default();
27950 __struct.time_boot_ms = buf.get_u32_le();
27951 __struct.xacc = buf.get_i16_le();
27952 __struct.yacc = buf.get_i16_le();
27953 __struct.zacc = buf.get_i16_le();
27954 __struct.xgyro = buf.get_i16_le();
27955 __struct.ygyro = buf.get_i16_le();
27956 __struct.zgyro = buf.get_i16_le();
27957 __struct.xmag = buf.get_i16_le();
27958 __struct.ymag = buf.get_i16_le();
27959 __struct.zmag = buf.get_i16_le();
27960 __struct.temperature = buf.get_i16_le();
27961 Ok(__struct)
27962 }
27963 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27964 let mut __tmp = BytesMut::new(bytes);
27965 #[allow(clippy::absurd_extreme_comparisons)]
27966 #[allow(unused_comparisons)]
27967 if __tmp.remaining() < Self::ENCODED_LEN {
27968 panic!(
27969 "buffer is too small (need {} bytes, but got {})",
27970 Self::ENCODED_LEN,
27971 __tmp.remaining(),
27972 )
27973 }
27974 __tmp.put_u32_le(self.time_boot_ms);
27975 __tmp.put_i16_le(self.xacc);
27976 __tmp.put_i16_le(self.yacc);
27977 __tmp.put_i16_le(self.zacc);
27978 __tmp.put_i16_le(self.xgyro);
27979 __tmp.put_i16_le(self.ygyro);
27980 __tmp.put_i16_le(self.zgyro);
27981 __tmp.put_i16_le(self.xmag);
27982 __tmp.put_i16_le(self.ymag);
27983 __tmp.put_i16_le(self.zmag);
27984 if matches!(version, MavlinkVersion::V2) {
27985 __tmp.put_i16_le(self.temperature);
27986 let len = __tmp.len();
27987 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27988 } else {
27989 __tmp.len()
27990 }
27991 }
27992}
27993#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
27994#[doc = ""]
27995#[doc = "ID: 29"]
27996#[derive(Debug, Clone, PartialEq)]
27997#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27998#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27999#[cfg_attr(feature = "ts", derive(TS))]
28000#[cfg_attr(feature = "ts", ts(export))]
28001pub struct SCALED_PRESSURE_DATA {
28002 #[doc = "Timestamp (time since system boot)."]
28003 pub time_boot_ms: u32,
28004 #[doc = "Absolute pressure"]
28005 pub press_abs: f32,
28006 #[doc = "Differential pressure 1"]
28007 pub press_diff: f32,
28008 #[doc = "Absolute pressure temperature"]
28009 pub temperature: i16,
28010 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
28011 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28012 pub temperature_press_diff: i16,
28013}
28014impl SCALED_PRESSURE_DATA {
28015 pub const ENCODED_LEN: usize = 16usize;
28016 pub const DEFAULT: Self = Self {
28017 time_boot_ms: 0_u32,
28018 press_abs: 0.0_f32,
28019 press_diff: 0.0_f32,
28020 temperature: 0_i16,
28021 temperature_press_diff: 0_i16,
28022 };
28023 #[cfg(feature = "arbitrary")]
28024 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28025 use arbitrary::{Arbitrary, Unstructured};
28026 let mut buf = [0u8; 1024];
28027 rng.fill_bytes(&mut buf);
28028 let mut unstructured = Unstructured::new(&buf);
28029 Self::arbitrary(&mut unstructured).unwrap_or_default()
28030 }
28031}
28032impl Default for SCALED_PRESSURE_DATA {
28033 fn default() -> Self {
28034 Self::DEFAULT.clone()
28035 }
28036}
28037impl MessageData for SCALED_PRESSURE_DATA {
28038 type Message = MavMessage;
28039 const ID: u32 = 29u32;
28040 const NAME: &'static str = "SCALED_PRESSURE";
28041 const EXTRA_CRC: u8 = 115u8;
28042 const ENCODED_LEN: usize = 16usize;
28043 fn deser(
28044 _version: MavlinkVersion,
28045 __input: &[u8],
28046 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28047 let avail_len = __input.len();
28048 let mut payload_buf = [0; Self::ENCODED_LEN];
28049 let mut buf = if avail_len < Self::ENCODED_LEN {
28050 payload_buf[0..avail_len].copy_from_slice(__input);
28051 Bytes::new(&payload_buf)
28052 } else {
28053 Bytes::new(__input)
28054 };
28055 let mut __struct = Self::default();
28056 __struct.time_boot_ms = buf.get_u32_le();
28057 __struct.press_abs = buf.get_f32_le();
28058 __struct.press_diff = buf.get_f32_le();
28059 __struct.temperature = buf.get_i16_le();
28060 __struct.temperature_press_diff = buf.get_i16_le();
28061 Ok(__struct)
28062 }
28063 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28064 let mut __tmp = BytesMut::new(bytes);
28065 #[allow(clippy::absurd_extreme_comparisons)]
28066 #[allow(unused_comparisons)]
28067 if __tmp.remaining() < Self::ENCODED_LEN {
28068 panic!(
28069 "buffer is too small (need {} bytes, but got {})",
28070 Self::ENCODED_LEN,
28071 __tmp.remaining(),
28072 )
28073 }
28074 __tmp.put_u32_le(self.time_boot_ms);
28075 __tmp.put_f32_le(self.press_abs);
28076 __tmp.put_f32_le(self.press_diff);
28077 __tmp.put_i16_le(self.temperature);
28078 if matches!(version, MavlinkVersion::V2) {
28079 __tmp.put_i16_le(self.temperature_press_diff);
28080 let len = __tmp.len();
28081 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28082 } else {
28083 __tmp.len()
28084 }
28085 }
28086}
28087#[doc = "Barometer readings for 2nd barometer."]
28088#[doc = ""]
28089#[doc = "ID: 137"]
28090#[derive(Debug, Clone, PartialEq)]
28091#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28092#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28093#[cfg_attr(feature = "ts", derive(TS))]
28094#[cfg_attr(feature = "ts", ts(export))]
28095pub struct SCALED_PRESSURE2_DATA {
28096 #[doc = "Timestamp (time since system boot)."]
28097 pub time_boot_ms: u32,
28098 #[doc = "Absolute pressure"]
28099 pub press_abs: f32,
28100 #[doc = "Differential pressure"]
28101 pub press_diff: f32,
28102 #[doc = "Absolute pressure temperature"]
28103 pub temperature: i16,
28104 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
28105 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28106 pub temperature_press_diff: i16,
28107}
28108impl SCALED_PRESSURE2_DATA {
28109 pub const ENCODED_LEN: usize = 16usize;
28110 pub const DEFAULT: Self = Self {
28111 time_boot_ms: 0_u32,
28112 press_abs: 0.0_f32,
28113 press_diff: 0.0_f32,
28114 temperature: 0_i16,
28115 temperature_press_diff: 0_i16,
28116 };
28117 #[cfg(feature = "arbitrary")]
28118 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28119 use arbitrary::{Arbitrary, Unstructured};
28120 let mut buf = [0u8; 1024];
28121 rng.fill_bytes(&mut buf);
28122 let mut unstructured = Unstructured::new(&buf);
28123 Self::arbitrary(&mut unstructured).unwrap_or_default()
28124 }
28125}
28126impl Default for SCALED_PRESSURE2_DATA {
28127 fn default() -> Self {
28128 Self::DEFAULT.clone()
28129 }
28130}
28131impl MessageData for SCALED_PRESSURE2_DATA {
28132 type Message = MavMessage;
28133 const ID: u32 = 137u32;
28134 const NAME: &'static str = "SCALED_PRESSURE2";
28135 const EXTRA_CRC: u8 = 195u8;
28136 const ENCODED_LEN: usize = 16usize;
28137 fn deser(
28138 _version: MavlinkVersion,
28139 __input: &[u8],
28140 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28141 let avail_len = __input.len();
28142 let mut payload_buf = [0; Self::ENCODED_LEN];
28143 let mut buf = if avail_len < Self::ENCODED_LEN {
28144 payload_buf[0..avail_len].copy_from_slice(__input);
28145 Bytes::new(&payload_buf)
28146 } else {
28147 Bytes::new(__input)
28148 };
28149 let mut __struct = Self::default();
28150 __struct.time_boot_ms = buf.get_u32_le();
28151 __struct.press_abs = buf.get_f32_le();
28152 __struct.press_diff = buf.get_f32_le();
28153 __struct.temperature = buf.get_i16_le();
28154 __struct.temperature_press_diff = buf.get_i16_le();
28155 Ok(__struct)
28156 }
28157 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28158 let mut __tmp = BytesMut::new(bytes);
28159 #[allow(clippy::absurd_extreme_comparisons)]
28160 #[allow(unused_comparisons)]
28161 if __tmp.remaining() < Self::ENCODED_LEN {
28162 panic!(
28163 "buffer is too small (need {} bytes, but got {})",
28164 Self::ENCODED_LEN,
28165 __tmp.remaining(),
28166 )
28167 }
28168 __tmp.put_u32_le(self.time_boot_ms);
28169 __tmp.put_f32_le(self.press_abs);
28170 __tmp.put_f32_le(self.press_diff);
28171 __tmp.put_i16_le(self.temperature);
28172 if matches!(version, MavlinkVersion::V2) {
28173 __tmp.put_i16_le(self.temperature_press_diff);
28174 let len = __tmp.len();
28175 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28176 } else {
28177 __tmp.len()
28178 }
28179 }
28180}
28181#[doc = "Barometer readings for 3rd barometer."]
28182#[doc = ""]
28183#[doc = "ID: 143"]
28184#[derive(Debug, Clone, PartialEq)]
28185#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28186#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28187#[cfg_attr(feature = "ts", derive(TS))]
28188#[cfg_attr(feature = "ts", ts(export))]
28189pub struct SCALED_PRESSURE3_DATA {
28190 #[doc = "Timestamp (time since system boot)."]
28191 pub time_boot_ms: u32,
28192 #[doc = "Absolute pressure"]
28193 pub press_abs: f32,
28194 #[doc = "Differential pressure"]
28195 pub press_diff: f32,
28196 #[doc = "Absolute pressure temperature"]
28197 pub temperature: i16,
28198 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
28199 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28200 pub temperature_press_diff: i16,
28201}
28202impl SCALED_PRESSURE3_DATA {
28203 pub const ENCODED_LEN: usize = 16usize;
28204 pub const DEFAULT: Self = Self {
28205 time_boot_ms: 0_u32,
28206 press_abs: 0.0_f32,
28207 press_diff: 0.0_f32,
28208 temperature: 0_i16,
28209 temperature_press_diff: 0_i16,
28210 };
28211 #[cfg(feature = "arbitrary")]
28212 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28213 use arbitrary::{Arbitrary, Unstructured};
28214 let mut buf = [0u8; 1024];
28215 rng.fill_bytes(&mut buf);
28216 let mut unstructured = Unstructured::new(&buf);
28217 Self::arbitrary(&mut unstructured).unwrap_or_default()
28218 }
28219}
28220impl Default for SCALED_PRESSURE3_DATA {
28221 fn default() -> Self {
28222 Self::DEFAULT.clone()
28223 }
28224}
28225impl MessageData for SCALED_PRESSURE3_DATA {
28226 type Message = MavMessage;
28227 const ID: u32 = 143u32;
28228 const NAME: &'static str = "SCALED_PRESSURE3";
28229 const EXTRA_CRC: u8 = 131u8;
28230 const ENCODED_LEN: usize = 16usize;
28231 fn deser(
28232 _version: MavlinkVersion,
28233 __input: &[u8],
28234 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28235 let avail_len = __input.len();
28236 let mut payload_buf = [0; Self::ENCODED_LEN];
28237 let mut buf = if avail_len < Self::ENCODED_LEN {
28238 payload_buf[0..avail_len].copy_from_slice(__input);
28239 Bytes::new(&payload_buf)
28240 } else {
28241 Bytes::new(__input)
28242 };
28243 let mut __struct = Self::default();
28244 __struct.time_boot_ms = buf.get_u32_le();
28245 __struct.press_abs = buf.get_f32_le();
28246 __struct.press_diff = buf.get_f32_le();
28247 __struct.temperature = buf.get_i16_le();
28248 __struct.temperature_press_diff = buf.get_i16_le();
28249 Ok(__struct)
28250 }
28251 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28252 let mut __tmp = BytesMut::new(bytes);
28253 #[allow(clippy::absurd_extreme_comparisons)]
28254 #[allow(unused_comparisons)]
28255 if __tmp.remaining() < Self::ENCODED_LEN {
28256 panic!(
28257 "buffer is too small (need {} bytes, but got {})",
28258 Self::ENCODED_LEN,
28259 __tmp.remaining(),
28260 )
28261 }
28262 __tmp.put_u32_le(self.time_boot_ms);
28263 __tmp.put_f32_le(self.press_abs);
28264 __tmp.put_f32_le(self.press_diff);
28265 __tmp.put_i16_le(self.temperature);
28266 if matches!(version, MavlinkVersion::V2) {
28267 __tmp.put_i16_le(self.temperature_press_diff);
28268 let len = __tmp.len();
28269 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28270 } else {
28271 __tmp.len()
28272 }
28273 }
28274}
28275#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
28276#[doc = ""]
28277#[doc = "ID: 126"]
28278#[derive(Debug, Clone, PartialEq)]
28279#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28280#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28281#[cfg_attr(feature = "ts", derive(TS))]
28282#[cfg_attr(feature = "ts", ts(export))]
28283pub struct SERIAL_CONTROL_DATA {
28284 #[doc = "Baudrate of transfer. Zero means no change."]
28285 pub baudrate: u32,
28286 #[doc = "Timeout for reply data"]
28287 pub timeout: u16,
28288 #[doc = "Serial control device type."]
28289 pub device: SerialControlDev,
28290 #[doc = "Bitmap of serial control flags."]
28291 pub flags: SerialControlFlag,
28292 #[doc = "how many bytes in this transfer"]
28293 pub count: u8,
28294 #[doc = "serial data"]
28295 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28296 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28297 pub data: [u8; 70],
28298 #[doc = "System ID"]
28299 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28300 pub target_system: u8,
28301 #[doc = "Component ID"]
28302 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28303 pub target_component: u8,
28304}
28305impl SERIAL_CONTROL_DATA {
28306 pub const ENCODED_LEN: usize = 81usize;
28307 pub const DEFAULT: Self = Self {
28308 baudrate: 0_u32,
28309 timeout: 0_u16,
28310 device: SerialControlDev::DEFAULT,
28311 flags: SerialControlFlag::DEFAULT,
28312 count: 0_u8,
28313 data: [0_u8; 70usize],
28314 target_system: 0_u8,
28315 target_component: 0_u8,
28316 };
28317 #[cfg(feature = "arbitrary")]
28318 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28319 use arbitrary::{Arbitrary, Unstructured};
28320 let mut buf = [0u8; 1024];
28321 rng.fill_bytes(&mut buf);
28322 let mut unstructured = Unstructured::new(&buf);
28323 Self::arbitrary(&mut unstructured).unwrap_or_default()
28324 }
28325}
28326impl Default for SERIAL_CONTROL_DATA {
28327 fn default() -> Self {
28328 Self::DEFAULT.clone()
28329 }
28330}
28331impl MessageData for SERIAL_CONTROL_DATA {
28332 type Message = MavMessage;
28333 const ID: u32 = 126u32;
28334 const NAME: &'static str = "SERIAL_CONTROL";
28335 const EXTRA_CRC: u8 = 220u8;
28336 const ENCODED_LEN: usize = 81usize;
28337 fn deser(
28338 _version: MavlinkVersion,
28339 __input: &[u8],
28340 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28341 let avail_len = __input.len();
28342 let mut payload_buf = [0; Self::ENCODED_LEN];
28343 let mut buf = if avail_len < Self::ENCODED_LEN {
28344 payload_buf[0..avail_len].copy_from_slice(__input);
28345 Bytes::new(&payload_buf)
28346 } else {
28347 Bytes::new(__input)
28348 };
28349 let mut __struct = Self::default();
28350 __struct.baudrate = buf.get_u32_le();
28351 __struct.timeout = buf.get_u16_le();
28352 let tmp = buf.get_u8();
28353 __struct.device =
28354 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28355 enum_type: "SerialControlDev",
28356 value: tmp as u32,
28357 })?;
28358 let tmp = buf.get_u8();
28359 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
28360 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28361 flag_type: "SerialControlFlag",
28362 value: tmp as u32,
28363 })?;
28364 __struct.count = buf.get_u8();
28365 for v in &mut __struct.data {
28366 let val = buf.get_u8();
28367 *v = val;
28368 }
28369 __struct.target_system = buf.get_u8();
28370 __struct.target_component = buf.get_u8();
28371 Ok(__struct)
28372 }
28373 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28374 let mut __tmp = BytesMut::new(bytes);
28375 #[allow(clippy::absurd_extreme_comparisons)]
28376 #[allow(unused_comparisons)]
28377 if __tmp.remaining() < Self::ENCODED_LEN {
28378 panic!(
28379 "buffer is too small (need {} bytes, but got {})",
28380 Self::ENCODED_LEN,
28381 __tmp.remaining(),
28382 )
28383 }
28384 __tmp.put_u32_le(self.baudrate);
28385 __tmp.put_u16_le(self.timeout);
28386 __tmp.put_u8(self.device as u8);
28387 __tmp.put_u8(self.flags.bits());
28388 __tmp.put_u8(self.count);
28389 for val in &self.data {
28390 __tmp.put_u8(*val);
28391 }
28392 if matches!(version, MavlinkVersion::V2) {
28393 __tmp.put_u8(self.target_system);
28394 __tmp.put_u8(self.target_component);
28395 let len = __tmp.len();
28396 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28397 } else {
28398 __tmp.len()
28399 }
28400 }
28401}
28402#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F13: format."]
28403#[doc = ""]
28404#[doc = "ID: 177"]
28405#[derive(Debug, Clone, PartialEq)]
28406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28408#[cfg_attr(feature = "ts", derive(TS))]
28409#[cfg_attr(feature = "ts", ts(export))]
28410pub struct SERIAL_UDB_EXTRA_F13_DATA {
28411 #[doc = "Serial UDB Extra MP Origin Latitude"]
28412 pub sue_lat_origin: i32,
28413 #[doc = "Serial UDB Extra MP Origin Longitude"]
28414 pub sue_lon_origin: i32,
28415 #[doc = "Serial UDB Extra MP Origin Altitude Above Sea Level"]
28416 pub sue_alt_origin: i32,
28417 #[doc = "Serial UDB Extra GPS Week Number"]
28418 pub sue_week_no: i16,
28419}
28420impl SERIAL_UDB_EXTRA_F13_DATA {
28421 pub const ENCODED_LEN: usize = 14usize;
28422 pub const DEFAULT: Self = Self {
28423 sue_lat_origin: 0_i32,
28424 sue_lon_origin: 0_i32,
28425 sue_alt_origin: 0_i32,
28426 sue_week_no: 0_i16,
28427 };
28428 #[cfg(feature = "arbitrary")]
28429 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28430 use arbitrary::{Arbitrary, Unstructured};
28431 let mut buf = [0u8; 1024];
28432 rng.fill_bytes(&mut buf);
28433 let mut unstructured = Unstructured::new(&buf);
28434 Self::arbitrary(&mut unstructured).unwrap_or_default()
28435 }
28436}
28437impl Default for SERIAL_UDB_EXTRA_F13_DATA {
28438 fn default() -> Self {
28439 Self::DEFAULT.clone()
28440 }
28441}
28442impl MessageData for SERIAL_UDB_EXTRA_F13_DATA {
28443 type Message = MavMessage;
28444 const ID: u32 = 177u32;
28445 const NAME: &'static str = "SERIAL_UDB_EXTRA_F13";
28446 const EXTRA_CRC: u8 = 249u8;
28447 const ENCODED_LEN: usize = 14usize;
28448 fn deser(
28449 _version: MavlinkVersion,
28450 __input: &[u8],
28451 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28452 let avail_len = __input.len();
28453 let mut payload_buf = [0; Self::ENCODED_LEN];
28454 let mut buf = if avail_len < Self::ENCODED_LEN {
28455 payload_buf[0..avail_len].copy_from_slice(__input);
28456 Bytes::new(&payload_buf)
28457 } else {
28458 Bytes::new(__input)
28459 };
28460 let mut __struct = Self::default();
28461 __struct.sue_lat_origin = buf.get_i32_le();
28462 __struct.sue_lon_origin = buf.get_i32_le();
28463 __struct.sue_alt_origin = buf.get_i32_le();
28464 __struct.sue_week_no = buf.get_i16_le();
28465 Ok(__struct)
28466 }
28467 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28468 let mut __tmp = BytesMut::new(bytes);
28469 #[allow(clippy::absurd_extreme_comparisons)]
28470 #[allow(unused_comparisons)]
28471 if __tmp.remaining() < Self::ENCODED_LEN {
28472 panic!(
28473 "buffer is too small (need {} bytes, but got {})",
28474 Self::ENCODED_LEN,
28475 __tmp.remaining(),
28476 )
28477 }
28478 __tmp.put_i32_le(self.sue_lat_origin);
28479 __tmp.put_i32_le(self.sue_lon_origin);
28480 __tmp.put_i32_le(self.sue_alt_origin);
28481 __tmp.put_i16_le(self.sue_week_no);
28482 if matches!(version, MavlinkVersion::V2) {
28483 let len = __tmp.len();
28484 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28485 } else {
28486 __tmp.len()
28487 }
28488 }
28489}
28490#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F14: format."]
28491#[doc = ""]
28492#[doc = "ID: 178"]
28493#[derive(Debug, Clone, PartialEq)]
28494#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28495#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28496#[cfg_attr(feature = "ts", derive(TS))]
28497#[cfg_attr(feature = "ts", ts(export))]
28498pub struct SERIAL_UDB_EXTRA_F14_DATA {
28499 #[doc = "Serial UDB Extra Type Program Address of Last Trap"]
28500 pub sue_TRAP_SOURCE: u32,
28501 #[doc = "Serial UDB Extra Reboot Register of DSPIC"]
28502 pub sue_RCON: i16,
28503 #[doc = "Serial UDB Extra Last dspic Trap Flags"]
28504 pub sue_TRAP_FLAGS: i16,
28505 #[doc = "Serial UDB Extra Number of Ocillator Failures"]
28506 pub sue_osc_fail_count: i16,
28507 #[doc = "Serial UDB Extra Wind Estimation Enabled"]
28508 pub sue_WIND_ESTIMATION: u8,
28509 #[doc = "Serial UDB Extra Type of GPS Unit"]
28510 pub sue_GPS_TYPE: u8,
28511 #[doc = "Serial UDB Extra Dead Reckoning Enabled"]
28512 pub sue_DR: u8,
28513 #[doc = "Serial UDB Extra Type of UDB Hardware"]
28514 pub sue_BOARD_TYPE: u8,
28515 #[doc = "Serial UDB Extra Type of Airframe"]
28516 pub sue_AIRFRAME: u8,
28517 #[doc = "Serial UDB Extra UDB Internal Clock Configuration"]
28518 pub sue_CLOCK_CONFIG: u8,
28519 #[doc = "Serial UDB Extra Type of Flight Plan"]
28520 pub sue_FLIGHT_PLAN_TYPE: u8,
28521}
28522impl SERIAL_UDB_EXTRA_F14_DATA {
28523 pub const ENCODED_LEN: usize = 17usize;
28524 pub const DEFAULT: Self = Self {
28525 sue_TRAP_SOURCE: 0_u32,
28526 sue_RCON: 0_i16,
28527 sue_TRAP_FLAGS: 0_i16,
28528 sue_osc_fail_count: 0_i16,
28529 sue_WIND_ESTIMATION: 0_u8,
28530 sue_GPS_TYPE: 0_u8,
28531 sue_DR: 0_u8,
28532 sue_BOARD_TYPE: 0_u8,
28533 sue_AIRFRAME: 0_u8,
28534 sue_CLOCK_CONFIG: 0_u8,
28535 sue_FLIGHT_PLAN_TYPE: 0_u8,
28536 };
28537 #[cfg(feature = "arbitrary")]
28538 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28539 use arbitrary::{Arbitrary, Unstructured};
28540 let mut buf = [0u8; 1024];
28541 rng.fill_bytes(&mut buf);
28542 let mut unstructured = Unstructured::new(&buf);
28543 Self::arbitrary(&mut unstructured).unwrap_or_default()
28544 }
28545}
28546impl Default for SERIAL_UDB_EXTRA_F14_DATA {
28547 fn default() -> Self {
28548 Self::DEFAULT.clone()
28549 }
28550}
28551impl MessageData for SERIAL_UDB_EXTRA_F14_DATA {
28552 type Message = MavMessage;
28553 const ID: u32 = 178u32;
28554 const NAME: &'static str = "SERIAL_UDB_EXTRA_F14";
28555 const EXTRA_CRC: u8 = 123u8;
28556 const ENCODED_LEN: usize = 17usize;
28557 fn deser(
28558 _version: MavlinkVersion,
28559 __input: &[u8],
28560 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28561 let avail_len = __input.len();
28562 let mut payload_buf = [0; Self::ENCODED_LEN];
28563 let mut buf = if avail_len < Self::ENCODED_LEN {
28564 payload_buf[0..avail_len].copy_from_slice(__input);
28565 Bytes::new(&payload_buf)
28566 } else {
28567 Bytes::new(__input)
28568 };
28569 let mut __struct = Self::default();
28570 __struct.sue_TRAP_SOURCE = buf.get_u32_le();
28571 __struct.sue_RCON = buf.get_i16_le();
28572 __struct.sue_TRAP_FLAGS = buf.get_i16_le();
28573 __struct.sue_osc_fail_count = buf.get_i16_le();
28574 __struct.sue_WIND_ESTIMATION = buf.get_u8();
28575 __struct.sue_GPS_TYPE = buf.get_u8();
28576 __struct.sue_DR = buf.get_u8();
28577 __struct.sue_BOARD_TYPE = buf.get_u8();
28578 __struct.sue_AIRFRAME = buf.get_u8();
28579 __struct.sue_CLOCK_CONFIG = buf.get_u8();
28580 __struct.sue_FLIGHT_PLAN_TYPE = buf.get_u8();
28581 Ok(__struct)
28582 }
28583 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28584 let mut __tmp = BytesMut::new(bytes);
28585 #[allow(clippy::absurd_extreme_comparisons)]
28586 #[allow(unused_comparisons)]
28587 if __tmp.remaining() < Self::ENCODED_LEN {
28588 panic!(
28589 "buffer is too small (need {} bytes, but got {})",
28590 Self::ENCODED_LEN,
28591 __tmp.remaining(),
28592 )
28593 }
28594 __tmp.put_u32_le(self.sue_TRAP_SOURCE);
28595 __tmp.put_i16_le(self.sue_RCON);
28596 __tmp.put_i16_le(self.sue_TRAP_FLAGS);
28597 __tmp.put_i16_le(self.sue_osc_fail_count);
28598 __tmp.put_u8(self.sue_WIND_ESTIMATION);
28599 __tmp.put_u8(self.sue_GPS_TYPE);
28600 __tmp.put_u8(self.sue_DR);
28601 __tmp.put_u8(self.sue_BOARD_TYPE);
28602 __tmp.put_u8(self.sue_AIRFRAME);
28603 __tmp.put_u8(self.sue_CLOCK_CONFIG);
28604 __tmp.put_u8(self.sue_FLIGHT_PLAN_TYPE);
28605 if matches!(version, MavlinkVersion::V2) {
28606 let len = __tmp.len();
28607 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28608 } else {
28609 __tmp.len()
28610 }
28611 }
28612}
28613#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F15 format."]
28614#[doc = ""]
28615#[doc = "ID: 179"]
28616#[derive(Debug, Clone, PartialEq)]
28617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28619#[cfg_attr(feature = "ts", derive(TS))]
28620#[cfg_attr(feature = "ts", ts(export))]
28621pub struct SERIAL_UDB_EXTRA_F15_DATA {
28622 #[doc = "Serial UDB Extra Model Name Of Vehicle"]
28623 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28624 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28625 pub sue_ID_VEHICLE_MODEL_NAME: [u8; 40],
28626 #[doc = "Serial UDB Extra Registraton Number of Vehicle"]
28627 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28628 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28629 pub sue_ID_VEHICLE_REGISTRATION: [u8; 20],
28630}
28631impl SERIAL_UDB_EXTRA_F15_DATA {
28632 pub const ENCODED_LEN: usize = 60usize;
28633 pub const DEFAULT: Self = Self {
28634 sue_ID_VEHICLE_MODEL_NAME: [0_u8; 40usize],
28635 sue_ID_VEHICLE_REGISTRATION: [0_u8; 20usize],
28636 };
28637 #[cfg(feature = "arbitrary")]
28638 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28639 use arbitrary::{Arbitrary, Unstructured};
28640 let mut buf = [0u8; 1024];
28641 rng.fill_bytes(&mut buf);
28642 let mut unstructured = Unstructured::new(&buf);
28643 Self::arbitrary(&mut unstructured).unwrap_or_default()
28644 }
28645}
28646impl Default for SERIAL_UDB_EXTRA_F15_DATA {
28647 fn default() -> Self {
28648 Self::DEFAULT.clone()
28649 }
28650}
28651impl MessageData for SERIAL_UDB_EXTRA_F15_DATA {
28652 type Message = MavMessage;
28653 const ID: u32 = 179u32;
28654 const NAME: &'static str = "SERIAL_UDB_EXTRA_F15";
28655 const EXTRA_CRC: u8 = 7u8;
28656 const ENCODED_LEN: usize = 60usize;
28657 fn deser(
28658 _version: MavlinkVersion,
28659 __input: &[u8],
28660 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28661 let avail_len = __input.len();
28662 let mut payload_buf = [0; Self::ENCODED_LEN];
28663 let mut buf = if avail_len < Self::ENCODED_LEN {
28664 payload_buf[0..avail_len].copy_from_slice(__input);
28665 Bytes::new(&payload_buf)
28666 } else {
28667 Bytes::new(__input)
28668 };
28669 let mut __struct = Self::default();
28670 for v in &mut __struct.sue_ID_VEHICLE_MODEL_NAME {
28671 let val = buf.get_u8();
28672 *v = val;
28673 }
28674 for v in &mut __struct.sue_ID_VEHICLE_REGISTRATION {
28675 let val = buf.get_u8();
28676 *v = val;
28677 }
28678 Ok(__struct)
28679 }
28680 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28681 let mut __tmp = BytesMut::new(bytes);
28682 #[allow(clippy::absurd_extreme_comparisons)]
28683 #[allow(unused_comparisons)]
28684 if __tmp.remaining() < Self::ENCODED_LEN {
28685 panic!(
28686 "buffer is too small (need {} bytes, but got {})",
28687 Self::ENCODED_LEN,
28688 __tmp.remaining(),
28689 )
28690 }
28691 for val in &self.sue_ID_VEHICLE_MODEL_NAME {
28692 __tmp.put_u8(*val);
28693 }
28694 for val in &self.sue_ID_VEHICLE_REGISTRATION {
28695 __tmp.put_u8(*val);
28696 }
28697 if matches!(version, MavlinkVersion::V2) {
28698 let len = __tmp.len();
28699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28700 } else {
28701 __tmp.len()
28702 }
28703 }
28704}
28705#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F16 format."]
28706#[doc = ""]
28707#[doc = "ID: 180"]
28708#[derive(Debug, Clone, PartialEq)]
28709#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28710#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28711#[cfg_attr(feature = "ts", derive(TS))]
28712#[cfg_attr(feature = "ts", ts(export))]
28713pub struct SERIAL_UDB_EXTRA_F16_DATA {
28714 #[doc = "Serial UDB Extra Name of Expected Lead Pilot"]
28715 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28716 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28717 pub sue_ID_LEAD_PILOT: [u8; 40],
28718 #[doc = "Serial UDB Extra URL of Lead Pilot or Team"]
28719 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28720 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28721 pub sue_ID_DIY_DRONES_URL: [u8; 70],
28722}
28723impl SERIAL_UDB_EXTRA_F16_DATA {
28724 pub const ENCODED_LEN: usize = 110usize;
28725 pub const DEFAULT: Self = Self {
28726 sue_ID_LEAD_PILOT: [0_u8; 40usize],
28727 sue_ID_DIY_DRONES_URL: [0_u8; 70usize],
28728 };
28729 #[cfg(feature = "arbitrary")]
28730 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28731 use arbitrary::{Arbitrary, Unstructured};
28732 let mut buf = [0u8; 1024];
28733 rng.fill_bytes(&mut buf);
28734 let mut unstructured = Unstructured::new(&buf);
28735 Self::arbitrary(&mut unstructured).unwrap_or_default()
28736 }
28737}
28738impl Default for SERIAL_UDB_EXTRA_F16_DATA {
28739 fn default() -> Self {
28740 Self::DEFAULT.clone()
28741 }
28742}
28743impl MessageData for SERIAL_UDB_EXTRA_F16_DATA {
28744 type Message = MavMessage;
28745 const ID: u32 = 180u32;
28746 const NAME: &'static str = "SERIAL_UDB_EXTRA_F16";
28747 const EXTRA_CRC: u8 = 222u8;
28748 const ENCODED_LEN: usize = 110usize;
28749 fn deser(
28750 _version: MavlinkVersion,
28751 __input: &[u8],
28752 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28753 let avail_len = __input.len();
28754 let mut payload_buf = [0; Self::ENCODED_LEN];
28755 let mut buf = if avail_len < Self::ENCODED_LEN {
28756 payload_buf[0..avail_len].copy_from_slice(__input);
28757 Bytes::new(&payload_buf)
28758 } else {
28759 Bytes::new(__input)
28760 };
28761 let mut __struct = Self::default();
28762 for v in &mut __struct.sue_ID_LEAD_PILOT {
28763 let val = buf.get_u8();
28764 *v = val;
28765 }
28766 for v in &mut __struct.sue_ID_DIY_DRONES_URL {
28767 let val = buf.get_u8();
28768 *v = val;
28769 }
28770 Ok(__struct)
28771 }
28772 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28773 let mut __tmp = BytesMut::new(bytes);
28774 #[allow(clippy::absurd_extreme_comparisons)]
28775 #[allow(unused_comparisons)]
28776 if __tmp.remaining() < Self::ENCODED_LEN {
28777 panic!(
28778 "buffer is too small (need {} bytes, but got {})",
28779 Self::ENCODED_LEN,
28780 __tmp.remaining(),
28781 )
28782 }
28783 for val in &self.sue_ID_LEAD_PILOT {
28784 __tmp.put_u8(*val);
28785 }
28786 for val in &self.sue_ID_DIY_DRONES_URL {
28787 __tmp.put_u8(*val);
28788 }
28789 if matches!(version, MavlinkVersion::V2) {
28790 let len = __tmp.len();
28791 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28792 } else {
28793 __tmp.len()
28794 }
28795 }
28796}
28797#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F17 format."]
28798#[doc = ""]
28799#[doc = "ID: 183"]
28800#[derive(Debug, Clone, PartialEq)]
28801#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28802#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28803#[cfg_attr(feature = "ts", derive(TS))]
28804#[cfg_attr(feature = "ts", ts(export))]
28805pub struct SERIAL_UDB_EXTRA_F17_DATA {
28806 #[doc = "SUE Feed Forward Gain"]
28807 pub sue_feed_forward: f32,
28808 #[doc = "SUE Max Turn Rate when Navigating"]
28809 pub sue_turn_rate_nav: f32,
28810 #[doc = "SUE Max Turn Rate in Fly By Wire Mode"]
28811 pub sue_turn_rate_fbw: f32,
28812}
28813impl SERIAL_UDB_EXTRA_F17_DATA {
28814 pub const ENCODED_LEN: usize = 12usize;
28815 pub const DEFAULT: Self = Self {
28816 sue_feed_forward: 0.0_f32,
28817 sue_turn_rate_nav: 0.0_f32,
28818 sue_turn_rate_fbw: 0.0_f32,
28819 };
28820 #[cfg(feature = "arbitrary")]
28821 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28822 use arbitrary::{Arbitrary, Unstructured};
28823 let mut buf = [0u8; 1024];
28824 rng.fill_bytes(&mut buf);
28825 let mut unstructured = Unstructured::new(&buf);
28826 Self::arbitrary(&mut unstructured).unwrap_or_default()
28827 }
28828}
28829impl Default for SERIAL_UDB_EXTRA_F17_DATA {
28830 fn default() -> Self {
28831 Self::DEFAULT.clone()
28832 }
28833}
28834impl MessageData for SERIAL_UDB_EXTRA_F17_DATA {
28835 type Message = MavMessage;
28836 const ID: u32 = 183u32;
28837 const NAME: &'static str = "SERIAL_UDB_EXTRA_F17";
28838 const EXTRA_CRC: u8 = 175u8;
28839 const ENCODED_LEN: usize = 12usize;
28840 fn deser(
28841 _version: MavlinkVersion,
28842 __input: &[u8],
28843 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28844 let avail_len = __input.len();
28845 let mut payload_buf = [0; Self::ENCODED_LEN];
28846 let mut buf = if avail_len < Self::ENCODED_LEN {
28847 payload_buf[0..avail_len].copy_from_slice(__input);
28848 Bytes::new(&payload_buf)
28849 } else {
28850 Bytes::new(__input)
28851 };
28852 let mut __struct = Self::default();
28853 __struct.sue_feed_forward = buf.get_f32_le();
28854 __struct.sue_turn_rate_nav = buf.get_f32_le();
28855 __struct.sue_turn_rate_fbw = buf.get_f32_le();
28856 Ok(__struct)
28857 }
28858 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28859 let mut __tmp = BytesMut::new(bytes);
28860 #[allow(clippy::absurd_extreme_comparisons)]
28861 #[allow(unused_comparisons)]
28862 if __tmp.remaining() < Self::ENCODED_LEN {
28863 panic!(
28864 "buffer is too small (need {} bytes, but got {})",
28865 Self::ENCODED_LEN,
28866 __tmp.remaining(),
28867 )
28868 }
28869 __tmp.put_f32_le(self.sue_feed_forward);
28870 __tmp.put_f32_le(self.sue_turn_rate_nav);
28871 __tmp.put_f32_le(self.sue_turn_rate_fbw);
28872 if matches!(version, MavlinkVersion::V2) {
28873 let len = __tmp.len();
28874 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28875 } else {
28876 __tmp.len()
28877 }
28878 }
28879}
28880#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F18 format."]
28881#[doc = ""]
28882#[doc = "ID: 184"]
28883#[derive(Debug, Clone, PartialEq)]
28884#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28885#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28886#[cfg_attr(feature = "ts", derive(TS))]
28887#[cfg_attr(feature = "ts", ts(export))]
28888pub struct SERIAL_UDB_EXTRA_F18_DATA {
28889 #[doc = "SUE Angle of Attack Normal"]
28890 pub angle_of_attack_normal: f32,
28891 #[doc = "SUE Angle of Attack Inverted"]
28892 pub angle_of_attack_inverted: f32,
28893 #[doc = "SUE Elevator Trim Normal"]
28894 pub elevator_trim_normal: f32,
28895 #[doc = "SUE Elevator Trim Inverted"]
28896 pub elevator_trim_inverted: f32,
28897 #[doc = "SUE reference_speed"]
28898 pub reference_speed: f32,
28899}
28900impl SERIAL_UDB_EXTRA_F18_DATA {
28901 pub const ENCODED_LEN: usize = 20usize;
28902 pub const DEFAULT: Self = Self {
28903 angle_of_attack_normal: 0.0_f32,
28904 angle_of_attack_inverted: 0.0_f32,
28905 elevator_trim_normal: 0.0_f32,
28906 elevator_trim_inverted: 0.0_f32,
28907 reference_speed: 0.0_f32,
28908 };
28909 #[cfg(feature = "arbitrary")]
28910 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28911 use arbitrary::{Arbitrary, Unstructured};
28912 let mut buf = [0u8; 1024];
28913 rng.fill_bytes(&mut buf);
28914 let mut unstructured = Unstructured::new(&buf);
28915 Self::arbitrary(&mut unstructured).unwrap_or_default()
28916 }
28917}
28918impl Default for SERIAL_UDB_EXTRA_F18_DATA {
28919 fn default() -> Self {
28920 Self::DEFAULT.clone()
28921 }
28922}
28923impl MessageData for SERIAL_UDB_EXTRA_F18_DATA {
28924 type Message = MavMessage;
28925 const ID: u32 = 184u32;
28926 const NAME: &'static str = "SERIAL_UDB_EXTRA_F18";
28927 const EXTRA_CRC: u8 = 41u8;
28928 const ENCODED_LEN: usize = 20usize;
28929 fn deser(
28930 _version: MavlinkVersion,
28931 __input: &[u8],
28932 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28933 let avail_len = __input.len();
28934 let mut payload_buf = [0; Self::ENCODED_LEN];
28935 let mut buf = if avail_len < Self::ENCODED_LEN {
28936 payload_buf[0..avail_len].copy_from_slice(__input);
28937 Bytes::new(&payload_buf)
28938 } else {
28939 Bytes::new(__input)
28940 };
28941 let mut __struct = Self::default();
28942 __struct.angle_of_attack_normal = buf.get_f32_le();
28943 __struct.angle_of_attack_inverted = buf.get_f32_le();
28944 __struct.elevator_trim_normal = buf.get_f32_le();
28945 __struct.elevator_trim_inverted = buf.get_f32_le();
28946 __struct.reference_speed = buf.get_f32_le();
28947 Ok(__struct)
28948 }
28949 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28950 let mut __tmp = BytesMut::new(bytes);
28951 #[allow(clippy::absurd_extreme_comparisons)]
28952 #[allow(unused_comparisons)]
28953 if __tmp.remaining() < Self::ENCODED_LEN {
28954 panic!(
28955 "buffer is too small (need {} bytes, but got {})",
28956 Self::ENCODED_LEN,
28957 __tmp.remaining(),
28958 )
28959 }
28960 __tmp.put_f32_le(self.angle_of_attack_normal);
28961 __tmp.put_f32_le(self.angle_of_attack_inverted);
28962 __tmp.put_f32_le(self.elevator_trim_normal);
28963 __tmp.put_f32_le(self.elevator_trim_inverted);
28964 __tmp.put_f32_le(self.reference_speed);
28965 if matches!(version, MavlinkVersion::V2) {
28966 let len = __tmp.len();
28967 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28968 } else {
28969 __tmp.len()
28970 }
28971 }
28972}
28973#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F19 format."]
28974#[doc = ""]
28975#[doc = "ID: 185"]
28976#[derive(Debug, Clone, PartialEq)]
28977#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28978#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28979#[cfg_attr(feature = "ts", derive(TS))]
28980#[cfg_attr(feature = "ts", ts(export))]
28981pub struct SERIAL_UDB_EXTRA_F19_DATA {
28982 #[doc = "SUE aileron output channel"]
28983 pub sue_aileron_output_channel: u8,
28984 #[doc = "SUE aileron reversed"]
28985 pub sue_aileron_reversed: u8,
28986 #[doc = "SUE elevator output channel"]
28987 pub sue_elevator_output_channel: u8,
28988 #[doc = "SUE elevator reversed"]
28989 pub sue_elevator_reversed: u8,
28990 #[doc = "SUE throttle output channel"]
28991 pub sue_throttle_output_channel: u8,
28992 #[doc = "SUE throttle reversed"]
28993 pub sue_throttle_reversed: u8,
28994 #[doc = "SUE rudder output channel"]
28995 pub sue_rudder_output_channel: u8,
28996 #[doc = "SUE rudder reversed"]
28997 pub sue_rudder_reversed: u8,
28998}
28999impl SERIAL_UDB_EXTRA_F19_DATA {
29000 pub const ENCODED_LEN: usize = 8usize;
29001 pub const DEFAULT: Self = Self {
29002 sue_aileron_output_channel: 0_u8,
29003 sue_aileron_reversed: 0_u8,
29004 sue_elevator_output_channel: 0_u8,
29005 sue_elevator_reversed: 0_u8,
29006 sue_throttle_output_channel: 0_u8,
29007 sue_throttle_reversed: 0_u8,
29008 sue_rudder_output_channel: 0_u8,
29009 sue_rudder_reversed: 0_u8,
29010 };
29011 #[cfg(feature = "arbitrary")]
29012 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29013 use arbitrary::{Arbitrary, Unstructured};
29014 let mut buf = [0u8; 1024];
29015 rng.fill_bytes(&mut buf);
29016 let mut unstructured = Unstructured::new(&buf);
29017 Self::arbitrary(&mut unstructured).unwrap_or_default()
29018 }
29019}
29020impl Default for SERIAL_UDB_EXTRA_F19_DATA {
29021 fn default() -> Self {
29022 Self::DEFAULT.clone()
29023 }
29024}
29025impl MessageData for SERIAL_UDB_EXTRA_F19_DATA {
29026 type Message = MavMessage;
29027 const ID: u32 = 185u32;
29028 const NAME: &'static str = "SERIAL_UDB_EXTRA_F19";
29029 const EXTRA_CRC: u8 = 87u8;
29030 const ENCODED_LEN: usize = 8usize;
29031 fn deser(
29032 _version: MavlinkVersion,
29033 __input: &[u8],
29034 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29035 let avail_len = __input.len();
29036 let mut payload_buf = [0; Self::ENCODED_LEN];
29037 let mut buf = if avail_len < Self::ENCODED_LEN {
29038 payload_buf[0..avail_len].copy_from_slice(__input);
29039 Bytes::new(&payload_buf)
29040 } else {
29041 Bytes::new(__input)
29042 };
29043 let mut __struct = Self::default();
29044 __struct.sue_aileron_output_channel = buf.get_u8();
29045 __struct.sue_aileron_reversed = buf.get_u8();
29046 __struct.sue_elevator_output_channel = buf.get_u8();
29047 __struct.sue_elevator_reversed = buf.get_u8();
29048 __struct.sue_throttle_output_channel = buf.get_u8();
29049 __struct.sue_throttle_reversed = buf.get_u8();
29050 __struct.sue_rudder_output_channel = buf.get_u8();
29051 __struct.sue_rudder_reversed = buf.get_u8();
29052 Ok(__struct)
29053 }
29054 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29055 let mut __tmp = BytesMut::new(bytes);
29056 #[allow(clippy::absurd_extreme_comparisons)]
29057 #[allow(unused_comparisons)]
29058 if __tmp.remaining() < Self::ENCODED_LEN {
29059 panic!(
29060 "buffer is too small (need {} bytes, but got {})",
29061 Self::ENCODED_LEN,
29062 __tmp.remaining(),
29063 )
29064 }
29065 __tmp.put_u8(self.sue_aileron_output_channel);
29066 __tmp.put_u8(self.sue_aileron_reversed);
29067 __tmp.put_u8(self.sue_elevator_output_channel);
29068 __tmp.put_u8(self.sue_elevator_reversed);
29069 __tmp.put_u8(self.sue_throttle_output_channel);
29070 __tmp.put_u8(self.sue_throttle_reversed);
29071 __tmp.put_u8(self.sue_rudder_output_channel);
29072 __tmp.put_u8(self.sue_rudder_reversed);
29073 if matches!(version, MavlinkVersion::V2) {
29074 let len = __tmp.len();
29075 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29076 } else {
29077 __tmp.len()
29078 }
29079 }
29080}
29081#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F20 format."]
29082#[doc = ""]
29083#[doc = "ID: 186"]
29084#[derive(Debug, Clone, PartialEq)]
29085#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29087#[cfg_attr(feature = "ts", derive(TS))]
29088#[cfg_attr(feature = "ts", ts(export))]
29089pub struct SERIAL_UDB_EXTRA_F20_DATA {
29090 #[doc = "SUE UDB PWM Trim Value on Input 1"]
29091 pub sue_trim_value_input_1: i16,
29092 #[doc = "SUE UDB PWM Trim Value on Input 2"]
29093 pub sue_trim_value_input_2: i16,
29094 #[doc = "SUE UDB PWM Trim Value on Input 3"]
29095 pub sue_trim_value_input_3: i16,
29096 #[doc = "SUE UDB PWM Trim Value on Input 4"]
29097 pub sue_trim_value_input_4: i16,
29098 #[doc = "SUE UDB PWM Trim Value on Input 5"]
29099 pub sue_trim_value_input_5: i16,
29100 #[doc = "SUE UDB PWM Trim Value on Input 6"]
29101 pub sue_trim_value_input_6: i16,
29102 #[doc = "SUE UDB PWM Trim Value on Input 7"]
29103 pub sue_trim_value_input_7: i16,
29104 #[doc = "SUE UDB PWM Trim Value on Input 8"]
29105 pub sue_trim_value_input_8: i16,
29106 #[doc = "SUE UDB PWM Trim Value on Input 9"]
29107 pub sue_trim_value_input_9: i16,
29108 #[doc = "SUE UDB PWM Trim Value on Input 10"]
29109 pub sue_trim_value_input_10: i16,
29110 #[doc = "SUE UDB PWM Trim Value on Input 11"]
29111 pub sue_trim_value_input_11: i16,
29112 #[doc = "SUE UDB PWM Trim Value on Input 12"]
29113 pub sue_trim_value_input_12: i16,
29114 #[doc = "SUE Number of Input Channels"]
29115 pub sue_number_of_inputs: u8,
29116}
29117impl SERIAL_UDB_EXTRA_F20_DATA {
29118 pub const ENCODED_LEN: usize = 25usize;
29119 pub const DEFAULT: Self = Self {
29120 sue_trim_value_input_1: 0_i16,
29121 sue_trim_value_input_2: 0_i16,
29122 sue_trim_value_input_3: 0_i16,
29123 sue_trim_value_input_4: 0_i16,
29124 sue_trim_value_input_5: 0_i16,
29125 sue_trim_value_input_6: 0_i16,
29126 sue_trim_value_input_7: 0_i16,
29127 sue_trim_value_input_8: 0_i16,
29128 sue_trim_value_input_9: 0_i16,
29129 sue_trim_value_input_10: 0_i16,
29130 sue_trim_value_input_11: 0_i16,
29131 sue_trim_value_input_12: 0_i16,
29132 sue_number_of_inputs: 0_u8,
29133 };
29134 #[cfg(feature = "arbitrary")]
29135 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29136 use arbitrary::{Arbitrary, Unstructured};
29137 let mut buf = [0u8; 1024];
29138 rng.fill_bytes(&mut buf);
29139 let mut unstructured = Unstructured::new(&buf);
29140 Self::arbitrary(&mut unstructured).unwrap_or_default()
29141 }
29142}
29143impl Default for SERIAL_UDB_EXTRA_F20_DATA {
29144 fn default() -> Self {
29145 Self::DEFAULT.clone()
29146 }
29147}
29148impl MessageData for SERIAL_UDB_EXTRA_F20_DATA {
29149 type Message = MavMessage;
29150 const ID: u32 = 186u32;
29151 const NAME: &'static str = "SERIAL_UDB_EXTRA_F20";
29152 const EXTRA_CRC: u8 = 144u8;
29153 const ENCODED_LEN: usize = 25usize;
29154 fn deser(
29155 _version: MavlinkVersion,
29156 __input: &[u8],
29157 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29158 let avail_len = __input.len();
29159 let mut payload_buf = [0; Self::ENCODED_LEN];
29160 let mut buf = if avail_len < Self::ENCODED_LEN {
29161 payload_buf[0..avail_len].copy_from_slice(__input);
29162 Bytes::new(&payload_buf)
29163 } else {
29164 Bytes::new(__input)
29165 };
29166 let mut __struct = Self::default();
29167 __struct.sue_trim_value_input_1 = buf.get_i16_le();
29168 __struct.sue_trim_value_input_2 = buf.get_i16_le();
29169 __struct.sue_trim_value_input_3 = buf.get_i16_le();
29170 __struct.sue_trim_value_input_4 = buf.get_i16_le();
29171 __struct.sue_trim_value_input_5 = buf.get_i16_le();
29172 __struct.sue_trim_value_input_6 = buf.get_i16_le();
29173 __struct.sue_trim_value_input_7 = buf.get_i16_le();
29174 __struct.sue_trim_value_input_8 = buf.get_i16_le();
29175 __struct.sue_trim_value_input_9 = buf.get_i16_le();
29176 __struct.sue_trim_value_input_10 = buf.get_i16_le();
29177 __struct.sue_trim_value_input_11 = buf.get_i16_le();
29178 __struct.sue_trim_value_input_12 = buf.get_i16_le();
29179 __struct.sue_number_of_inputs = buf.get_u8();
29180 Ok(__struct)
29181 }
29182 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29183 let mut __tmp = BytesMut::new(bytes);
29184 #[allow(clippy::absurd_extreme_comparisons)]
29185 #[allow(unused_comparisons)]
29186 if __tmp.remaining() < Self::ENCODED_LEN {
29187 panic!(
29188 "buffer is too small (need {} bytes, but got {})",
29189 Self::ENCODED_LEN,
29190 __tmp.remaining(),
29191 )
29192 }
29193 __tmp.put_i16_le(self.sue_trim_value_input_1);
29194 __tmp.put_i16_le(self.sue_trim_value_input_2);
29195 __tmp.put_i16_le(self.sue_trim_value_input_3);
29196 __tmp.put_i16_le(self.sue_trim_value_input_4);
29197 __tmp.put_i16_le(self.sue_trim_value_input_5);
29198 __tmp.put_i16_le(self.sue_trim_value_input_6);
29199 __tmp.put_i16_le(self.sue_trim_value_input_7);
29200 __tmp.put_i16_le(self.sue_trim_value_input_8);
29201 __tmp.put_i16_le(self.sue_trim_value_input_9);
29202 __tmp.put_i16_le(self.sue_trim_value_input_10);
29203 __tmp.put_i16_le(self.sue_trim_value_input_11);
29204 __tmp.put_i16_le(self.sue_trim_value_input_12);
29205 __tmp.put_u8(self.sue_number_of_inputs);
29206 if matches!(version, MavlinkVersion::V2) {
29207 let len = __tmp.len();
29208 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29209 } else {
29210 __tmp.len()
29211 }
29212 }
29213}
29214#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F21 format."]
29215#[doc = ""]
29216#[doc = "ID: 187"]
29217#[derive(Debug, Clone, PartialEq)]
29218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29219#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29220#[cfg_attr(feature = "ts", derive(TS))]
29221#[cfg_attr(feature = "ts", ts(export))]
29222pub struct SERIAL_UDB_EXTRA_F21_DATA {
29223 #[doc = "SUE X accelerometer offset"]
29224 pub sue_accel_x_offset: i16,
29225 #[doc = "SUE Y accelerometer offset"]
29226 pub sue_accel_y_offset: i16,
29227 #[doc = "SUE Z accelerometer offset"]
29228 pub sue_accel_z_offset: i16,
29229 #[doc = "SUE X gyro offset"]
29230 pub sue_gyro_x_offset: i16,
29231 #[doc = "SUE Y gyro offset"]
29232 pub sue_gyro_y_offset: i16,
29233 #[doc = "SUE Z gyro offset"]
29234 pub sue_gyro_z_offset: i16,
29235}
29236impl SERIAL_UDB_EXTRA_F21_DATA {
29237 pub const ENCODED_LEN: usize = 12usize;
29238 pub const DEFAULT: Self = Self {
29239 sue_accel_x_offset: 0_i16,
29240 sue_accel_y_offset: 0_i16,
29241 sue_accel_z_offset: 0_i16,
29242 sue_gyro_x_offset: 0_i16,
29243 sue_gyro_y_offset: 0_i16,
29244 sue_gyro_z_offset: 0_i16,
29245 };
29246 #[cfg(feature = "arbitrary")]
29247 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29248 use arbitrary::{Arbitrary, Unstructured};
29249 let mut buf = [0u8; 1024];
29250 rng.fill_bytes(&mut buf);
29251 let mut unstructured = Unstructured::new(&buf);
29252 Self::arbitrary(&mut unstructured).unwrap_or_default()
29253 }
29254}
29255impl Default for SERIAL_UDB_EXTRA_F21_DATA {
29256 fn default() -> Self {
29257 Self::DEFAULT.clone()
29258 }
29259}
29260impl MessageData for SERIAL_UDB_EXTRA_F21_DATA {
29261 type Message = MavMessage;
29262 const ID: u32 = 187u32;
29263 const NAME: &'static str = "SERIAL_UDB_EXTRA_F21";
29264 const EXTRA_CRC: u8 = 134u8;
29265 const ENCODED_LEN: usize = 12usize;
29266 fn deser(
29267 _version: MavlinkVersion,
29268 __input: &[u8],
29269 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29270 let avail_len = __input.len();
29271 let mut payload_buf = [0; Self::ENCODED_LEN];
29272 let mut buf = if avail_len < Self::ENCODED_LEN {
29273 payload_buf[0..avail_len].copy_from_slice(__input);
29274 Bytes::new(&payload_buf)
29275 } else {
29276 Bytes::new(__input)
29277 };
29278 let mut __struct = Self::default();
29279 __struct.sue_accel_x_offset = buf.get_i16_le();
29280 __struct.sue_accel_y_offset = buf.get_i16_le();
29281 __struct.sue_accel_z_offset = buf.get_i16_le();
29282 __struct.sue_gyro_x_offset = buf.get_i16_le();
29283 __struct.sue_gyro_y_offset = buf.get_i16_le();
29284 __struct.sue_gyro_z_offset = buf.get_i16_le();
29285 Ok(__struct)
29286 }
29287 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29288 let mut __tmp = BytesMut::new(bytes);
29289 #[allow(clippy::absurd_extreme_comparisons)]
29290 #[allow(unused_comparisons)]
29291 if __tmp.remaining() < Self::ENCODED_LEN {
29292 panic!(
29293 "buffer is too small (need {} bytes, but got {})",
29294 Self::ENCODED_LEN,
29295 __tmp.remaining(),
29296 )
29297 }
29298 __tmp.put_i16_le(self.sue_accel_x_offset);
29299 __tmp.put_i16_le(self.sue_accel_y_offset);
29300 __tmp.put_i16_le(self.sue_accel_z_offset);
29301 __tmp.put_i16_le(self.sue_gyro_x_offset);
29302 __tmp.put_i16_le(self.sue_gyro_y_offset);
29303 __tmp.put_i16_le(self.sue_gyro_z_offset);
29304 if matches!(version, MavlinkVersion::V2) {
29305 let len = __tmp.len();
29306 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29307 } else {
29308 __tmp.len()
29309 }
29310 }
29311}
29312#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F22 format."]
29313#[doc = ""]
29314#[doc = "ID: 188"]
29315#[derive(Debug, Clone, PartialEq)]
29316#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29318#[cfg_attr(feature = "ts", derive(TS))]
29319#[cfg_attr(feature = "ts", ts(export))]
29320pub struct SERIAL_UDB_EXTRA_F22_DATA {
29321 #[doc = "SUE X accelerometer at calibration time"]
29322 pub sue_accel_x_at_calibration: i16,
29323 #[doc = "SUE Y accelerometer at calibration time"]
29324 pub sue_accel_y_at_calibration: i16,
29325 #[doc = "SUE Z accelerometer at calibration time"]
29326 pub sue_accel_z_at_calibration: i16,
29327 #[doc = "SUE X gyro at calibration time"]
29328 pub sue_gyro_x_at_calibration: i16,
29329 #[doc = "SUE Y gyro at calibration time"]
29330 pub sue_gyro_y_at_calibration: i16,
29331 #[doc = "SUE Z gyro at calibration time"]
29332 pub sue_gyro_z_at_calibration: i16,
29333}
29334impl SERIAL_UDB_EXTRA_F22_DATA {
29335 pub const ENCODED_LEN: usize = 12usize;
29336 pub const DEFAULT: Self = Self {
29337 sue_accel_x_at_calibration: 0_i16,
29338 sue_accel_y_at_calibration: 0_i16,
29339 sue_accel_z_at_calibration: 0_i16,
29340 sue_gyro_x_at_calibration: 0_i16,
29341 sue_gyro_y_at_calibration: 0_i16,
29342 sue_gyro_z_at_calibration: 0_i16,
29343 };
29344 #[cfg(feature = "arbitrary")]
29345 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29346 use arbitrary::{Arbitrary, Unstructured};
29347 let mut buf = [0u8; 1024];
29348 rng.fill_bytes(&mut buf);
29349 let mut unstructured = Unstructured::new(&buf);
29350 Self::arbitrary(&mut unstructured).unwrap_or_default()
29351 }
29352}
29353impl Default for SERIAL_UDB_EXTRA_F22_DATA {
29354 fn default() -> Self {
29355 Self::DEFAULT.clone()
29356 }
29357}
29358impl MessageData for SERIAL_UDB_EXTRA_F22_DATA {
29359 type Message = MavMessage;
29360 const ID: u32 = 188u32;
29361 const NAME: &'static str = "SERIAL_UDB_EXTRA_F22";
29362 const EXTRA_CRC: u8 = 91u8;
29363 const ENCODED_LEN: usize = 12usize;
29364 fn deser(
29365 _version: MavlinkVersion,
29366 __input: &[u8],
29367 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29368 let avail_len = __input.len();
29369 let mut payload_buf = [0; Self::ENCODED_LEN];
29370 let mut buf = if avail_len < Self::ENCODED_LEN {
29371 payload_buf[0..avail_len].copy_from_slice(__input);
29372 Bytes::new(&payload_buf)
29373 } else {
29374 Bytes::new(__input)
29375 };
29376 let mut __struct = Self::default();
29377 __struct.sue_accel_x_at_calibration = buf.get_i16_le();
29378 __struct.sue_accel_y_at_calibration = buf.get_i16_le();
29379 __struct.sue_accel_z_at_calibration = buf.get_i16_le();
29380 __struct.sue_gyro_x_at_calibration = buf.get_i16_le();
29381 __struct.sue_gyro_y_at_calibration = buf.get_i16_le();
29382 __struct.sue_gyro_z_at_calibration = buf.get_i16_le();
29383 Ok(__struct)
29384 }
29385 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29386 let mut __tmp = BytesMut::new(bytes);
29387 #[allow(clippy::absurd_extreme_comparisons)]
29388 #[allow(unused_comparisons)]
29389 if __tmp.remaining() < Self::ENCODED_LEN {
29390 panic!(
29391 "buffer is too small (need {} bytes, but got {})",
29392 Self::ENCODED_LEN,
29393 __tmp.remaining(),
29394 )
29395 }
29396 __tmp.put_i16_le(self.sue_accel_x_at_calibration);
29397 __tmp.put_i16_le(self.sue_accel_y_at_calibration);
29398 __tmp.put_i16_le(self.sue_accel_z_at_calibration);
29399 __tmp.put_i16_le(self.sue_gyro_x_at_calibration);
29400 __tmp.put_i16_le(self.sue_gyro_y_at_calibration);
29401 __tmp.put_i16_le(self.sue_gyro_z_at_calibration);
29402 if matches!(version, MavlinkVersion::V2) {
29403 let len = __tmp.len();
29404 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29405 } else {
29406 __tmp.len()
29407 }
29408 }
29409}
29410#[doc = "Backwards compatible MAVLink version of SERIAL_UDB_EXTRA - F2: Format Part A."]
29411#[doc = ""]
29412#[doc = "ID: 170"]
29413#[derive(Debug, Clone, PartialEq)]
29414#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29415#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29416#[cfg_attr(feature = "ts", derive(TS))]
29417#[cfg_attr(feature = "ts", ts(export))]
29418pub struct SERIAL_UDB_EXTRA_F2_A_DATA {
29419 #[doc = "Serial UDB Extra Time"]
29420 pub sue_time: u32,
29421 #[doc = "Serial UDB Extra Latitude"]
29422 pub sue_latitude: i32,
29423 #[doc = "Serial UDB Extra Longitude"]
29424 pub sue_longitude: i32,
29425 #[doc = "Serial UDB Extra Altitude"]
29426 pub sue_altitude: i32,
29427 #[doc = "Serial UDB Extra Waypoint Index"]
29428 pub sue_waypoint_index: u16,
29429 #[doc = "Serial UDB Extra Rmat 0"]
29430 pub sue_rmat0: i16,
29431 #[doc = "Serial UDB Extra Rmat 1"]
29432 pub sue_rmat1: i16,
29433 #[doc = "Serial UDB Extra Rmat 2"]
29434 pub sue_rmat2: i16,
29435 #[doc = "Serial UDB Extra Rmat 3"]
29436 pub sue_rmat3: i16,
29437 #[doc = "Serial UDB Extra Rmat 4"]
29438 pub sue_rmat4: i16,
29439 #[doc = "Serial UDB Extra Rmat 5"]
29440 pub sue_rmat5: i16,
29441 #[doc = "Serial UDB Extra Rmat 6"]
29442 pub sue_rmat6: i16,
29443 #[doc = "Serial UDB Extra Rmat 7"]
29444 pub sue_rmat7: i16,
29445 #[doc = "Serial UDB Extra Rmat 8"]
29446 pub sue_rmat8: i16,
29447 #[doc = "Serial UDB Extra GPS Course Over Ground"]
29448 pub sue_cog: u16,
29449 #[doc = "Serial UDB Extra Speed Over Ground"]
29450 pub sue_sog: i16,
29451 #[doc = "Serial UDB Extra CPU Load"]
29452 pub sue_cpu_load: u16,
29453 #[doc = "Serial UDB Extra 3D IMU Air Speed"]
29454 pub sue_air_speed_3DIMU: u16,
29455 #[doc = "Serial UDB Extra Estimated Wind 0"]
29456 pub sue_estimated_wind_0: i16,
29457 #[doc = "Serial UDB Extra Estimated Wind 1"]
29458 pub sue_estimated_wind_1: i16,
29459 #[doc = "Serial UDB Extra Estimated Wind 2"]
29460 pub sue_estimated_wind_2: i16,
29461 #[doc = "Serial UDB Extra Magnetic Field Earth 0"]
29462 pub sue_magFieldEarth0: i16,
29463 #[doc = "Serial UDB Extra Magnetic Field Earth 1"]
29464 pub sue_magFieldEarth1: i16,
29465 #[doc = "Serial UDB Extra Magnetic Field Earth 2"]
29466 pub sue_magFieldEarth2: i16,
29467 #[doc = "Serial UDB Extra Number of Satellites in View"]
29468 pub sue_svs: i16,
29469 #[doc = "Serial UDB Extra GPS Horizontal Dilution of Precision"]
29470 pub sue_hdop: i16,
29471 #[doc = "Serial UDB Extra Status"]
29472 pub sue_status: u8,
29473}
29474impl SERIAL_UDB_EXTRA_F2_A_DATA {
29475 pub const ENCODED_LEN: usize = 61usize;
29476 pub const DEFAULT: Self = Self {
29477 sue_time: 0_u32,
29478 sue_latitude: 0_i32,
29479 sue_longitude: 0_i32,
29480 sue_altitude: 0_i32,
29481 sue_waypoint_index: 0_u16,
29482 sue_rmat0: 0_i16,
29483 sue_rmat1: 0_i16,
29484 sue_rmat2: 0_i16,
29485 sue_rmat3: 0_i16,
29486 sue_rmat4: 0_i16,
29487 sue_rmat5: 0_i16,
29488 sue_rmat6: 0_i16,
29489 sue_rmat7: 0_i16,
29490 sue_rmat8: 0_i16,
29491 sue_cog: 0_u16,
29492 sue_sog: 0_i16,
29493 sue_cpu_load: 0_u16,
29494 sue_air_speed_3DIMU: 0_u16,
29495 sue_estimated_wind_0: 0_i16,
29496 sue_estimated_wind_1: 0_i16,
29497 sue_estimated_wind_2: 0_i16,
29498 sue_magFieldEarth0: 0_i16,
29499 sue_magFieldEarth1: 0_i16,
29500 sue_magFieldEarth2: 0_i16,
29501 sue_svs: 0_i16,
29502 sue_hdop: 0_i16,
29503 sue_status: 0_u8,
29504 };
29505 #[cfg(feature = "arbitrary")]
29506 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29507 use arbitrary::{Arbitrary, Unstructured};
29508 let mut buf = [0u8; 1024];
29509 rng.fill_bytes(&mut buf);
29510 let mut unstructured = Unstructured::new(&buf);
29511 Self::arbitrary(&mut unstructured).unwrap_or_default()
29512 }
29513}
29514impl Default for SERIAL_UDB_EXTRA_F2_A_DATA {
29515 fn default() -> Self {
29516 Self::DEFAULT.clone()
29517 }
29518}
29519impl MessageData for SERIAL_UDB_EXTRA_F2_A_DATA {
29520 type Message = MavMessage;
29521 const ID: u32 = 170u32;
29522 const NAME: &'static str = "SERIAL_UDB_EXTRA_F2_A";
29523 const EXTRA_CRC: u8 = 103u8;
29524 const ENCODED_LEN: usize = 61usize;
29525 fn deser(
29526 _version: MavlinkVersion,
29527 __input: &[u8],
29528 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29529 let avail_len = __input.len();
29530 let mut payload_buf = [0; Self::ENCODED_LEN];
29531 let mut buf = if avail_len < Self::ENCODED_LEN {
29532 payload_buf[0..avail_len].copy_from_slice(__input);
29533 Bytes::new(&payload_buf)
29534 } else {
29535 Bytes::new(__input)
29536 };
29537 let mut __struct = Self::default();
29538 __struct.sue_time = buf.get_u32_le();
29539 __struct.sue_latitude = buf.get_i32_le();
29540 __struct.sue_longitude = buf.get_i32_le();
29541 __struct.sue_altitude = buf.get_i32_le();
29542 __struct.sue_waypoint_index = buf.get_u16_le();
29543 __struct.sue_rmat0 = buf.get_i16_le();
29544 __struct.sue_rmat1 = buf.get_i16_le();
29545 __struct.sue_rmat2 = buf.get_i16_le();
29546 __struct.sue_rmat3 = buf.get_i16_le();
29547 __struct.sue_rmat4 = buf.get_i16_le();
29548 __struct.sue_rmat5 = buf.get_i16_le();
29549 __struct.sue_rmat6 = buf.get_i16_le();
29550 __struct.sue_rmat7 = buf.get_i16_le();
29551 __struct.sue_rmat8 = buf.get_i16_le();
29552 __struct.sue_cog = buf.get_u16_le();
29553 __struct.sue_sog = buf.get_i16_le();
29554 __struct.sue_cpu_load = buf.get_u16_le();
29555 __struct.sue_air_speed_3DIMU = buf.get_u16_le();
29556 __struct.sue_estimated_wind_0 = buf.get_i16_le();
29557 __struct.sue_estimated_wind_1 = buf.get_i16_le();
29558 __struct.sue_estimated_wind_2 = buf.get_i16_le();
29559 __struct.sue_magFieldEarth0 = buf.get_i16_le();
29560 __struct.sue_magFieldEarth1 = buf.get_i16_le();
29561 __struct.sue_magFieldEarth2 = buf.get_i16_le();
29562 __struct.sue_svs = buf.get_i16_le();
29563 __struct.sue_hdop = buf.get_i16_le();
29564 __struct.sue_status = buf.get_u8();
29565 Ok(__struct)
29566 }
29567 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29568 let mut __tmp = BytesMut::new(bytes);
29569 #[allow(clippy::absurd_extreme_comparisons)]
29570 #[allow(unused_comparisons)]
29571 if __tmp.remaining() < Self::ENCODED_LEN {
29572 panic!(
29573 "buffer is too small (need {} bytes, but got {})",
29574 Self::ENCODED_LEN,
29575 __tmp.remaining(),
29576 )
29577 }
29578 __tmp.put_u32_le(self.sue_time);
29579 __tmp.put_i32_le(self.sue_latitude);
29580 __tmp.put_i32_le(self.sue_longitude);
29581 __tmp.put_i32_le(self.sue_altitude);
29582 __tmp.put_u16_le(self.sue_waypoint_index);
29583 __tmp.put_i16_le(self.sue_rmat0);
29584 __tmp.put_i16_le(self.sue_rmat1);
29585 __tmp.put_i16_le(self.sue_rmat2);
29586 __tmp.put_i16_le(self.sue_rmat3);
29587 __tmp.put_i16_le(self.sue_rmat4);
29588 __tmp.put_i16_le(self.sue_rmat5);
29589 __tmp.put_i16_le(self.sue_rmat6);
29590 __tmp.put_i16_le(self.sue_rmat7);
29591 __tmp.put_i16_le(self.sue_rmat8);
29592 __tmp.put_u16_le(self.sue_cog);
29593 __tmp.put_i16_le(self.sue_sog);
29594 __tmp.put_u16_le(self.sue_cpu_load);
29595 __tmp.put_u16_le(self.sue_air_speed_3DIMU);
29596 __tmp.put_i16_le(self.sue_estimated_wind_0);
29597 __tmp.put_i16_le(self.sue_estimated_wind_1);
29598 __tmp.put_i16_le(self.sue_estimated_wind_2);
29599 __tmp.put_i16_le(self.sue_magFieldEarth0);
29600 __tmp.put_i16_le(self.sue_magFieldEarth1);
29601 __tmp.put_i16_le(self.sue_magFieldEarth2);
29602 __tmp.put_i16_le(self.sue_svs);
29603 __tmp.put_i16_le(self.sue_hdop);
29604 __tmp.put_u8(self.sue_status);
29605 if matches!(version, MavlinkVersion::V2) {
29606 let len = __tmp.len();
29607 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29608 } else {
29609 __tmp.len()
29610 }
29611 }
29612}
29613#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA - F2: Part B."]
29614#[doc = ""]
29615#[doc = "ID: 171"]
29616#[derive(Debug, Clone, PartialEq)]
29617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29619#[cfg_attr(feature = "ts", derive(TS))]
29620#[cfg_attr(feature = "ts", ts(export))]
29621pub struct SERIAL_UDB_EXTRA_F2_B_DATA {
29622 #[doc = "Serial UDB Extra Time"]
29623 pub sue_time: u32,
29624 #[doc = "Serial UDB Extra Status Flags"]
29625 pub sue_flags: u32,
29626 #[doc = "SUE barometer pressure"]
29627 pub sue_barom_press: i32,
29628 #[doc = "SUE barometer altitude"]
29629 pub sue_barom_alt: i32,
29630 #[doc = "Serial UDB Extra PWM Input Channel 1"]
29631 pub sue_pwm_input_1: i16,
29632 #[doc = "Serial UDB Extra PWM Input Channel 2"]
29633 pub sue_pwm_input_2: i16,
29634 #[doc = "Serial UDB Extra PWM Input Channel 3"]
29635 pub sue_pwm_input_3: i16,
29636 #[doc = "Serial UDB Extra PWM Input Channel 4"]
29637 pub sue_pwm_input_4: i16,
29638 #[doc = "Serial UDB Extra PWM Input Channel 5"]
29639 pub sue_pwm_input_5: i16,
29640 #[doc = "Serial UDB Extra PWM Input Channel 6"]
29641 pub sue_pwm_input_6: i16,
29642 #[doc = "Serial UDB Extra PWM Input Channel 7"]
29643 pub sue_pwm_input_7: i16,
29644 #[doc = "Serial UDB Extra PWM Input Channel 8"]
29645 pub sue_pwm_input_8: i16,
29646 #[doc = "Serial UDB Extra PWM Input Channel 9"]
29647 pub sue_pwm_input_9: i16,
29648 #[doc = "Serial UDB Extra PWM Input Channel 10"]
29649 pub sue_pwm_input_10: i16,
29650 #[doc = "Serial UDB Extra PWM Input Channel 11"]
29651 pub sue_pwm_input_11: i16,
29652 #[doc = "Serial UDB Extra PWM Input Channel 12"]
29653 pub sue_pwm_input_12: i16,
29654 #[doc = "Serial UDB Extra PWM Output Channel 1"]
29655 pub sue_pwm_output_1: i16,
29656 #[doc = "Serial UDB Extra PWM Output Channel 2"]
29657 pub sue_pwm_output_2: i16,
29658 #[doc = "Serial UDB Extra PWM Output Channel 3"]
29659 pub sue_pwm_output_3: i16,
29660 #[doc = "Serial UDB Extra PWM Output Channel 4"]
29661 pub sue_pwm_output_4: i16,
29662 #[doc = "Serial UDB Extra PWM Output Channel 5"]
29663 pub sue_pwm_output_5: i16,
29664 #[doc = "Serial UDB Extra PWM Output Channel 6"]
29665 pub sue_pwm_output_6: i16,
29666 #[doc = "Serial UDB Extra PWM Output Channel 7"]
29667 pub sue_pwm_output_7: i16,
29668 #[doc = "Serial UDB Extra PWM Output Channel 8"]
29669 pub sue_pwm_output_8: i16,
29670 #[doc = "Serial UDB Extra PWM Output Channel 9"]
29671 pub sue_pwm_output_9: i16,
29672 #[doc = "Serial UDB Extra PWM Output Channel 10"]
29673 pub sue_pwm_output_10: i16,
29674 #[doc = "Serial UDB Extra PWM Output Channel 11"]
29675 pub sue_pwm_output_11: i16,
29676 #[doc = "Serial UDB Extra PWM Output Channel 12"]
29677 pub sue_pwm_output_12: i16,
29678 #[doc = "Serial UDB Extra IMU Location X"]
29679 pub sue_imu_location_x: i16,
29680 #[doc = "Serial UDB Extra IMU Location Y"]
29681 pub sue_imu_location_y: i16,
29682 #[doc = "Serial UDB Extra IMU Location Z"]
29683 pub sue_imu_location_z: i16,
29684 #[doc = "Serial UDB Location Error Earth X"]
29685 pub sue_location_error_earth_x: i16,
29686 #[doc = "Serial UDB Location Error Earth Y"]
29687 pub sue_location_error_earth_y: i16,
29688 #[doc = "Serial UDB Location Error Earth Z"]
29689 pub sue_location_error_earth_z: i16,
29690 #[doc = "Serial UDB Extra Oscillator Failure Count"]
29691 pub sue_osc_fails: i16,
29692 #[doc = "Serial UDB Extra IMU Velocity X"]
29693 pub sue_imu_velocity_x: i16,
29694 #[doc = "Serial UDB Extra IMU Velocity Y"]
29695 pub sue_imu_velocity_y: i16,
29696 #[doc = "Serial UDB Extra IMU Velocity Z"]
29697 pub sue_imu_velocity_z: i16,
29698 #[doc = "Serial UDB Extra Current Waypoint Goal X"]
29699 pub sue_waypoint_goal_x: i16,
29700 #[doc = "Serial UDB Extra Current Waypoint Goal Y"]
29701 pub sue_waypoint_goal_y: i16,
29702 #[doc = "Serial UDB Extra Current Waypoint Goal Z"]
29703 pub sue_waypoint_goal_z: i16,
29704 #[doc = "Aeroforce in UDB X Axis"]
29705 pub sue_aero_x: i16,
29706 #[doc = "Aeroforce in UDB Y Axis"]
29707 pub sue_aero_y: i16,
29708 #[doc = "Aeroforce in UDB Z axis"]
29709 pub sue_aero_z: i16,
29710 #[doc = "SUE barometer temperature"]
29711 pub sue_barom_temp: i16,
29712 #[doc = "SUE battery voltage"]
29713 pub sue_bat_volt: i16,
29714 #[doc = "SUE battery current"]
29715 pub sue_bat_amp: i16,
29716 #[doc = "SUE battery milli amp hours used"]
29717 pub sue_bat_amp_hours: i16,
29718 #[doc = "Sue autopilot desired height"]
29719 pub sue_desired_height: i16,
29720 #[doc = "Serial UDB Extra Stack Memory Free"]
29721 pub sue_memory_stack_free: i16,
29722}
29723impl SERIAL_UDB_EXTRA_F2_B_DATA {
29724 pub const ENCODED_LEN: usize = 108usize;
29725 pub const DEFAULT: Self = Self {
29726 sue_time: 0_u32,
29727 sue_flags: 0_u32,
29728 sue_barom_press: 0_i32,
29729 sue_barom_alt: 0_i32,
29730 sue_pwm_input_1: 0_i16,
29731 sue_pwm_input_2: 0_i16,
29732 sue_pwm_input_3: 0_i16,
29733 sue_pwm_input_4: 0_i16,
29734 sue_pwm_input_5: 0_i16,
29735 sue_pwm_input_6: 0_i16,
29736 sue_pwm_input_7: 0_i16,
29737 sue_pwm_input_8: 0_i16,
29738 sue_pwm_input_9: 0_i16,
29739 sue_pwm_input_10: 0_i16,
29740 sue_pwm_input_11: 0_i16,
29741 sue_pwm_input_12: 0_i16,
29742 sue_pwm_output_1: 0_i16,
29743 sue_pwm_output_2: 0_i16,
29744 sue_pwm_output_3: 0_i16,
29745 sue_pwm_output_4: 0_i16,
29746 sue_pwm_output_5: 0_i16,
29747 sue_pwm_output_6: 0_i16,
29748 sue_pwm_output_7: 0_i16,
29749 sue_pwm_output_8: 0_i16,
29750 sue_pwm_output_9: 0_i16,
29751 sue_pwm_output_10: 0_i16,
29752 sue_pwm_output_11: 0_i16,
29753 sue_pwm_output_12: 0_i16,
29754 sue_imu_location_x: 0_i16,
29755 sue_imu_location_y: 0_i16,
29756 sue_imu_location_z: 0_i16,
29757 sue_location_error_earth_x: 0_i16,
29758 sue_location_error_earth_y: 0_i16,
29759 sue_location_error_earth_z: 0_i16,
29760 sue_osc_fails: 0_i16,
29761 sue_imu_velocity_x: 0_i16,
29762 sue_imu_velocity_y: 0_i16,
29763 sue_imu_velocity_z: 0_i16,
29764 sue_waypoint_goal_x: 0_i16,
29765 sue_waypoint_goal_y: 0_i16,
29766 sue_waypoint_goal_z: 0_i16,
29767 sue_aero_x: 0_i16,
29768 sue_aero_y: 0_i16,
29769 sue_aero_z: 0_i16,
29770 sue_barom_temp: 0_i16,
29771 sue_bat_volt: 0_i16,
29772 sue_bat_amp: 0_i16,
29773 sue_bat_amp_hours: 0_i16,
29774 sue_desired_height: 0_i16,
29775 sue_memory_stack_free: 0_i16,
29776 };
29777 #[cfg(feature = "arbitrary")]
29778 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29779 use arbitrary::{Arbitrary, Unstructured};
29780 let mut buf = [0u8; 1024];
29781 rng.fill_bytes(&mut buf);
29782 let mut unstructured = Unstructured::new(&buf);
29783 Self::arbitrary(&mut unstructured).unwrap_or_default()
29784 }
29785}
29786impl Default for SERIAL_UDB_EXTRA_F2_B_DATA {
29787 fn default() -> Self {
29788 Self::DEFAULT.clone()
29789 }
29790}
29791impl MessageData for SERIAL_UDB_EXTRA_F2_B_DATA {
29792 type Message = MavMessage;
29793 const ID: u32 = 171u32;
29794 const NAME: &'static str = "SERIAL_UDB_EXTRA_F2_B";
29795 const EXTRA_CRC: u8 = 245u8;
29796 const ENCODED_LEN: usize = 108usize;
29797 fn deser(
29798 _version: MavlinkVersion,
29799 __input: &[u8],
29800 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29801 let avail_len = __input.len();
29802 let mut payload_buf = [0; Self::ENCODED_LEN];
29803 let mut buf = if avail_len < Self::ENCODED_LEN {
29804 payload_buf[0..avail_len].copy_from_slice(__input);
29805 Bytes::new(&payload_buf)
29806 } else {
29807 Bytes::new(__input)
29808 };
29809 let mut __struct = Self::default();
29810 __struct.sue_time = buf.get_u32_le();
29811 __struct.sue_flags = buf.get_u32_le();
29812 __struct.sue_barom_press = buf.get_i32_le();
29813 __struct.sue_barom_alt = buf.get_i32_le();
29814 __struct.sue_pwm_input_1 = buf.get_i16_le();
29815 __struct.sue_pwm_input_2 = buf.get_i16_le();
29816 __struct.sue_pwm_input_3 = buf.get_i16_le();
29817 __struct.sue_pwm_input_4 = buf.get_i16_le();
29818 __struct.sue_pwm_input_5 = buf.get_i16_le();
29819 __struct.sue_pwm_input_6 = buf.get_i16_le();
29820 __struct.sue_pwm_input_7 = buf.get_i16_le();
29821 __struct.sue_pwm_input_8 = buf.get_i16_le();
29822 __struct.sue_pwm_input_9 = buf.get_i16_le();
29823 __struct.sue_pwm_input_10 = buf.get_i16_le();
29824 __struct.sue_pwm_input_11 = buf.get_i16_le();
29825 __struct.sue_pwm_input_12 = buf.get_i16_le();
29826 __struct.sue_pwm_output_1 = buf.get_i16_le();
29827 __struct.sue_pwm_output_2 = buf.get_i16_le();
29828 __struct.sue_pwm_output_3 = buf.get_i16_le();
29829 __struct.sue_pwm_output_4 = buf.get_i16_le();
29830 __struct.sue_pwm_output_5 = buf.get_i16_le();
29831 __struct.sue_pwm_output_6 = buf.get_i16_le();
29832 __struct.sue_pwm_output_7 = buf.get_i16_le();
29833 __struct.sue_pwm_output_8 = buf.get_i16_le();
29834 __struct.sue_pwm_output_9 = buf.get_i16_le();
29835 __struct.sue_pwm_output_10 = buf.get_i16_le();
29836 __struct.sue_pwm_output_11 = buf.get_i16_le();
29837 __struct.sue_pwm_output_12 = buf.get_i16_le();
29838 __struct.sue_imu_location_x = buf.get_i16_le();
29839 __struct.sue_imu_location_y = buf.get_i16_le();
29840 __struct.sue_imu_location_z = buf.get_i16_le();
29841 __struct.sue_location_error_earth_x = buf.get_i16_le();
29842 __struct.sue_location_error_earth_y = buf.get_i16_le();
29843 __struct.sue_location_error_earth_z = buf.get_i16_le();
29844 __struct.sue_osc_fails = buf.get_i16_le();
29845 __struct.sue_imu_velocity_x = buf.get_i16_le();
29846 __struct.sue_imu_velocity_y = buf.get_i16_le();
29847 __struct.sue_imu_velocity_z = buf.get_i16_le();
29848 __struct.sue_waypoint_goal_x = buf.get_i16_le();
29849 __struct.sue_waypoint_goal_y = buf.get_i16_le();
29850 __struct.sue_waypoint_goal_z = buf.get_i16_le();
29851 __struct.sue_aero_x = buf.get_i16_le();
29852 __struct.sue_aero_y = buf.get_i16_le();
29853 __struct.sue_aero_z = buf.get_i16_le();
29854 __struct.sue_barom_temp = buf.get_i16_le();
29855 __struct.sue_bat_volt = buf.get_i16_le();
29856 __struct.sue_bat_amp = buf.get_i16_le();
29857 __struct.sue_bat_amp_hours = buf.get_i16_le();
29858 __struct.sue_desired_height = buf.get_i16_le();
29859 __struct.sue_memory_stack_free = buf.get_i16_le();
29860 Ok(__struct)
29861 }
29862 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29863 let mut __tmp = BytesMut::new(bytes);
29864 #[allow(clippy::absurd_extreme_comparisons)]
29865 #[allow(unused_comparisons)]
29866 if __tmp.remaining() < Self::ENCODED_LEN {
29867 panic!(
29868 "buffer is too small (need {} bytes, but got {})",
29869 Self::ENCODED_LEN,
29870 __tmp.remaining(),
29871 )
29872 }
29873 __tmp.put_u32_le(self.sue_time);
29874 __tmp.put_u32_le(self.sue_flags);
29875 __tmp.put_i32_le(self.sue_barom_press);
29876 __tmp.put_i32_le(self.sue_barom_alt);
29877 __tmp.put_i16_le(self.sue_pwm_input_1);
29878 __tmp.put_i16_le(self.sue_pwm_input_2);
29879 __tmp.put_i16_le(self.sue_pwm_input_3);
29880 __tmp.put_i16_le(self.sue_pwm_input_4);
29881 __tmp.put_i16_le(self.sue_pwm_input_5);
29882 __tmp.put_i16_le(self.sue_pwm_input_6);
29883 __tmp.put_i16_le(self.sue_pwm_input_7);
29884 __tmp.put_i16_le(self.sue_pwm_input_8);
29885 __tmp.put_i16_le(self.sue_pwm_input_9);
29886 __tmp.put_i16_le(self.sue_pwm_input_10);
29887 __tmp.put_i16_le(self.sue_pwm_input_11);
29888 __tmp.put_i16_le(self.sue_pwm_input_12);
29889 __tmp.put_i16_le(self.sue_pwm_output_1);
29890 __tmp.put_i16_le(self.sue_pwm_output_2);
29891 __tmp.put_i16_le(self.sue_pwm_output_3);
29892 __tmp.put_i16_le(self.sue_pwm_output_4);
29893 __tmp.put_i16_le(self.sue_pwm_output_5);
29894 __tmp.put_i16_le(self.sue_pwm_output_6);
29895 __tmp.put_i16_le(self.sue_pwm_output_7);
29896 __tmp.put_i16_le(self.sue_pwm_output_8);
29897 __tmp.put_i16_le(self.sue_pwm_output_9);
29898 __tmp.put_i16_le(self.sue_pwm_output_10);
29899 __tmp.put_i16_le(self.sue_pwm_output_11);
29900 __tmp.put_i16_le(self.sue_pwm_output_12);
29901 __tmp.put_i16_le(self.sue_imu_location_x);
29902 __tmp.put_i16_le(self.sue_imu_location_y);
29903 __tmp.put_i16_le(self.sue_imu_location_z);
29904 __tmp.put_i16_le(self.sue_location_error_earth_x);
29905 __tmp.put_i16_le(self.sue_location_error_earth_y);
29906 __tmp.put_i16_le(self.sue_location_error_earth_z);
29907 __tmp.put_i16_le(self.sue_osc_fails);
29908 __tmp.put_i16_le(self.sue_imu_velocity_x);
29909 __tmp.put_i16_le(self.sue_imu_velocity_y);
29910 __tmp.put_i16_le(self.sue_imu_velocity_z);
29911 __tmp.put_i16_le(self.sue_waypoint_goal_x);
29912 __tmp.put_i16_le(self.sue_waypoint_goal_y);
29913 __tmp.put_i16_le(self.sue_waypoint_goal_z);
29914 __tmp.put_i16_le(self.sue_aero_x);
29915 __tmp.put_i16_le(self.sue_aero_y);
29916 __tmp.put_i16_le(self.sue_aero_z);
29917 __tmp.put_i16_le(self.sue_barom_temp);
29918 __tmp.put_i16_le(self.sue_bat_volt);
29919 __tmp.put_i16_le(self.sue_bat_amp);
29920 __tmp.put_i16_le(self.sue_bat_amp_hours);
29921 __tmp.put_i16_le(self.sue_desired_height);
29922 __tmp.put_i16_le(self.sue_memory_stack_free);
29923 if matches!(version, MavlinkVersion::V2) {
29924 let len = __tmp.len();
29925 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29926 } else {
29927 __tmp.len()
29928 }
29929 }
29930}
29931#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F4: format."]
29932#[doc = ""]
29933#[doc = "ID: 172"]
29934#[derive(Debug, Clone, PartialEq)]
29935#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29936#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29937#[cfg_attr(feature = "ts", derive(TS))]
29938#[cfg_attr(feature = "ts", ts(export))]
29939pub struct SERIAL_UDB_EXTRA_F4_DATA {
29940 #[doc = "Serial UDB Extra Roll Stabilization with Ailerons Enabled"]
29941 pub sue_ROLL_STABILIZATION_AILERONS: u8,
29942 #[doc = "Serial UDB Extra Roll Stabilization with Rudder Enabled"]
29943 pub sue_ROLL_STABILIZATION_RUDDER: u8,
29944 #[doc = "Serial UDB Extra Pitch Stabilization Enabled"]
29945 pub sue_PITCH_STABILIZATION: u8,
29946 #[doc = "Serial UDB Extra Yaw Stabilization using Rudder Enabled"]
29947 pub sue_YAW_STABILIZATION_RUDDER: u8,
29948 #[doc = "Serial UDB Extra Yaw Stabilization using Ailerons Enabled"]
29949 pub sue_YAW_STABILIZATION_AILERON: u8,
29950 #[doc = "Serial UDB Extra Navigation with Ailerons Enabled"]
29951 pub sue_AILERON_NAVIGATION: u8,
29952 #[doc = "Serial UDB Extra Navigation with Rudder Enabled"]
29953 pub sue_RUDDER_NAVIGATION: u8,
29954 #[doc = "Serial UDB Extra Type of Alitude Hold when in Stabilized Mode"]
29955 pub sue_ALTITUDEHOLD_STABILIZED: u8,
29956 #[doc = "Serial UDB Extra Type of Alitude Hold when in Waypoint Mode"]
29957 pub sue_ALTITUDEHOLD_WAYPOINT: u8,
29958 #[doc = "Serial UDB Extra Firmware racing mode enabled"]
29959 pub sue_RACING_MODE: u8,
29960}
29961impl SERIAL_UDB_EXTRA_F4_DATA {
29962 pub const ENCODED_LEN: usize = 10usize;
29963 pub const DEFAULT: Self = Self {
29964 sue_ROLL_STABILIZATION_AILERONS: 0_u8,
29965 sue_ROLL_STABILIZATION_RUDDER: 0_u8,
29966 sue_PITCH_STABILIZATION: 0_u8,
29967 sue_YAW_STABILIZATION_RUDDER: 0_u8,
29968 sue_YAW_STABILIZATION_AILERON: 0_u8,
29969 sue_AILERON_NAVIGATION: 0_u8,
29970 sue_RUDDER_NAVIGATION: 0_u8,
29971 sue_ALTITUDEHOLD_STABILIZED: 0_u8,
29972 sue_ALTITUDEHOLD_WAYPOINT: 0_u8,
29973 sue_RACING_MODE: 0_u8,
29974 };
29975 #[cfg(feature = "arbitrary")]
29976 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29977 use arbitrary::{Arbitrary, Unstructured};
29978 let mut buf = [0u8; 1024];
29979 rng.fill_bytes(&mut buf);
29980 let mut unstructured = Unstructured::new(&buf);
29981 Self::arbitrary(&mut unstructured).unwrap_or_default()
29982 }
29983}
29984impl Default for SERIAL_UDB_EXTRA_F4_DATA {
29985 fn default() -> Self {
29986 Self::DEFAULT.clone()
29987 }
29988}
29989impl MessageData for SERIAL_UDB_EXTRA_F4_DATA {
29990 type Message = MavMessage;
29991 const ID: u32 = 172u32;
29992 const NAME: &'static str = "SERIAL_UDB_EXTRA_F4";
29993 const EXTRA_CRC: u8 = 191u8;
29994 const ENCODED_LEN: usize = 10usize;
29995 fn deser(
29996 _version: MavlinkVersion,
29997 __input: &[u8],
29998 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29999 let avail_len = __input.len();
30000 let mut payload_buf = [0; Self::ENCODED_LEN];
30001 let mut buf = if avail_len < Self::ENCODED_LEN {
30002 payload_buf[0..avail_len].copy_from_slice(__input);
30003 Bytes::new(&payload_buf)
30004 } else {
30005 Bytes::new(__input)
30006 };
30007 let mut __struct = Self::default();
30008 __struct.sue_ROLL_STABILIZATION_AILERONS = buf.get_u8();
30009 __struct.sue_ROLL_STABILIZATION_RUDDER = buf.get_u8();
30010 __struct.sue_PITCH_STABILIZATION = buf.get_u8();
30011 __struct.sue_YAW_STABILIZATION_RUDDER = buf.get_u8();
30012 __struct.sue_YAW_STABILIZATION_AILERON = buf.get_u8();
30013 __struct.sue_AILERON_NAVIGATION = buf.get_u8();
30014 __struct.sue_RUDDER_NAVIGATION = buf.get_u8();
30015 __struct.sue_ALTITUDEHOLD_STABILIZED = buf.get_u8();
30016 __struct.sue_ALTITUDEHOLD_WAYPOINT = buf.get_u8();
30017 __struct.sue_RACING_MODE = buf.get_u8();
30018 Ok(__struct)
30019 }
30020 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30021 let mut __tmp = BytesMut::new(bytes);
30022 #[allow(clippy::absurd_extreme_comparisons)]
30023 #[allow(unused_comparisons)]
30024 if __tmp.remaining() < Self::ENCODED_LEN {
30025 panic!(
30026 "buffer is too small (need {} bytes, but got {})",
30027 Self::ENCODED_LEN,
30028 __tmp.remaining(),
30029 )
30030 }
30031 __tmp.put_u8(self.sue_ROLL_STABILIZATION_AILERONS);
30032 __tmp.put_u8(self.sue_ROLL_STABILIZATION_RUDDER);
30033 __tmp.put_u8(self.sue_PITCH_STABILIZATION);
30034 __tmp.put_u8(self.sue_YAW_STABILIZATION_RUDDER);
30035 __tmp.put_u8(self.sue_YAW_STABILIZATION_AILERON);
30036 __tmp.put_u8(self.sue_AILERON_NAVIGATION);
30037 __tmp.put_u8(self.sue_RUDDER_NAVIGATION);
30038 __tmp.put_u8(self.sue_ALTITUDEHOLD_STABILIZED);
30039 __tmp.put_u8(self.sue_ALTITUDEHOLD_WAYPOINT);
30040 __tmp.put_u8(self.sue_RACING_MODE);
30041 if matches!(version, MavlinkVersion::V2) {
30042 let len = __tmp.len();
30043 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30044 } else {
30045 __tmp.len()
30046 }
30047 }
30048}
30049#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F5: format."]
30050#[doc = ""]
30051#[doc = "ID: 173"]
30052#[derive(Debug, Clone, PartialEq)]
30053#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30054#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30055#[cfg_attr(feature = "ts", derive(TS))]
30056#[cfg_attr(feature = "ts", ts(export))]
30057pub struct SERIAL_UDB_EXTRA_F5_DATA {
30058 #[doc = "Serial UDB YAWKP_AILERON Gain for Proporional control of navigation"]
30059 pub sue_YAWKP_AILERON: f32,
30060 #[doc = "Serial UDB YAWKD_AILERON Gain for Rate control of navigation"]
30061 pub sue_YAWKD_AILERON: f32,
30062 #[doc = "Serial UDB Extra ROLLKP Gain for Proportional control of roll stabilization"]
30063 pub sue_ROLLKP: f32,
30064 #[doc = "Serial UDB Extra ROLLKD Gain for Rate control of roll stabilization"]
30065 pub sue_ROLLKD: f32,
30066}
30067impl SERIAL_UDB_EXTRA_F5_DATA {
30068 pub const ENCODED_LEN: usize = 16usize;
30069 pub const DEFAULT: Self = Self {
30070 sue_YAWKP_AILERON: 0.0_f32,
30071 sue_YAWKD_AILERON: 0.0_f32,
30072 sue_ROLLKP: 0.0_f32,
30073 sue_ROLLKD: 0.0_f32,
30074 };
30075 #[cfg(feature = "arbitrary")]
30076 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30077 use arbitrary::{Arbitrary, Unstructured};
30078 let mut buf = [0u8; 1024];
30079 rng.fill_bytes(&mut buf);
30080 let mut unstructured = Unstructured::new(&buf);
30081 Self::arbitrary(&mut unstructured).unwrap_or_default()
30082 }
30083}
30084impl Default for SERIAL_UDB_EXTRA_F5_DATA {
30085 fn default() -> Self {
30086 Self::DEFAULT.clone()
30087 }
30088}
30089impl MessageData for SERIAL_UDB_EXTRA_F5_DATA {
30090 type Message = MavMessage;
30091 const ID: u32 = 173u32;
30092 const NAME: &'static str = "SERIAL_UDB_EXTRA_F5";
30093 const EXTRA_CRC: u8 = 54u8;
30094 const ENCODED_LEN: usize = 16usize;
30095 fn deser(
30096 _version: MavlinkVersion,
30097 __input: &[u8],
30098 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30099 let avail_len = __input.len();
30100 let mut payload_buf = [0; Self::ENCODED_LEN];
30101 let mut buf = if avail_len < Self::ENCODED_LEN {
30102 payload_buf[0..avail_len].copy_from_slice(__input);
30103 Bytes::new(&payload_buf)
30104 } else {
30105 Bytes::new(__input)
30106 };
30107 let mut __struct = Self::default();
30108 __struct.sue_YAWKP_AILERON = buf.get_f32_le();
30109 __struct.sue_YAWKD_AILERON = buf.get_f32_le();
30110 __struct.sue_ROLLKP = buf.get_f32_le();
30111 __struct.sue_ROLLKD = buf.get_f32_le();
30112 Ok(__struct)
30113 }
30114 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30115 let mut __tmp = BytesMut::new(bytes);
30116 #[allow(clippy::absurd_extreme_comparisons)]
30117 #[allow(unused_comparisons)]
30118 if __tmp.remaining() < Self::ENCODED_LEN {
30119 panic!(
30120 "buffer is too small (need {} bytes, but got {})",
30121 Self::ENCODED_LEN,
30122 __tmp.remaining(),
30123 )
30124 }
30125 __tmp.put_f32_le(self.sue_YAWKP_AILERON);
30126 __tmp.put_f32_le(self.sue_YAWKD_AILERON);
30127 __tmp.put_f32_le(self.sue_ROLLKP);
30128 __tmp.put_f32_le(self.sue_ROLLKD);
30129 if matches!(version, MavlinkVersion::V2) {
30130 let len = __tmp.len();
30131 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30132 } else {
30133 __tmp.len()
30134 }
30135 }
30136}
30137#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F6: format."]
30138#[doc = ""]
30139#[doc = "ID: 174"]
30140#[derive(Debug, Clone, PartialEq)]
30141#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30142#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30143#[cfg_attr(feature = "ts", derive(TS))]
30144#[cfg_attr(feature = "ts", ts(export))]
30145pub struct SERIAL_UDB_EXTRA_F6_DATA {
30146 #[doc = "Serial UDB Extra PITCHGAIN Proportional Control"]
30147 pub sue_PITCHGAIN: f32,
30148 #[doc = "Serial UDB Extra Pitch Rate Control"]
30149 pub sue_PITCHKD: f32,
30150 #[doc = "Serial UDB Extra Rudder to Elevator Mix"]
30151 pub sue_RUDDER_ELEV_MIX: f32,
30152 #[doc = "Serial UDB Extra Roll to Elevator Mix"]
30153 pub sue_ROLL_ELEV_MIX: f32,
30154 #[doc = "Gain For Boosting Manual Elevator control When Plane Stabilized"]
30155 pub sue_ELEVATOR_BOOST: f32,
30156}
30157impl SERIAL_UDB_EXTRA_F6_DATA {
30158 pub const ENCODED_LEN: usize = 20usize;
30159 pub const DEFAULT: Self = Self {
30160 sue_PITCHGAIN: 0.0_f32,
30161 sue_PITCHKD: 0.0_f32,
30162 sue_RUDDER_ELEV_MIX: 0.0_f32,
30163 sue_ROLL_ELEV_MIX: 0.0_f32,
30164 sue_ELEVATOR_BOOST: 0.0_f32,
30165 };
30166 #[cfg(feature = "arbitrary")]
30167 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30168 use arbitrary::{Arbitrary, Unstructured};
30169 let mut buf = [0u8; 1024];
30170 rng.fill_bytes(&mut buf);
30171 let mut unstructured = Unstructured::new(&buf);
30172 Self::arbitrary(&mut unstructured).unwrap_or_default()
30173 }
30174}
30175impl Default for SERIAL_UDB_EXTRA_F6_DATA {
30176 fn default() -> Self {
30177 Self::DEFAULT.clone()
30178 }
30179}
30180impl MessageData for SERIAL_UDB_EXTRA_F6_DATA {
30181 type Message = MavMessage;
30182 const ID: u32 = 174u32;
30183 const NAME: &'static str = "SERIAL_UDB_EXTRA_F6";
30184 const EXTRA_CRC: u8 = 54u8;
30185 const ENCODED_LEN: usize = 20usize;
30186 fn deser(
30187 _version: MavlinkVersion,
30188 __input: &[u8],
30189 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30190 let avail_len = __input.len();
30191 let mut payload_buf = [0; Self::ENCODED_LEN];
30192 let mut buf = if avail_len < Self::ENCODED_LEN {
30193 payload_buf[0..avail_len].copy_from_slice(__input);
30194 Bytes::new(&payload_buf)
30195 } else {
30196 Bytes::new(__input)
30197 };
30198 let mut __struct = Self::default();
30199 __struct.sue_PITCHGAIN = buf.get_f32_le();
30200 __struct.sue_PITCHKD = buf.get_f32_le();
30201 __struct.sue_RUDDER_ELEV_MIX = buf.get_f32_le();
30202 __struct.sue_ROLL_ELEV_MIX = buf.get_f32_le();
30203 __struct.sue_ELEVATOR_BOOST = buf.get_f32_le();
30204 Ok(__struct)
30205 }
30206 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30207 let mut __tmp = BytesMut::new(bytes);
30208 #[allow(clippy::absurd_extreme_comparisons)]
30209 #[allow(unused_comparisons)]
30210 if __tmp.remaining() < Self::ENCODED_LEN {
30211 panic!(
30212 "buffer is too small (need {} bytes, but got {})",
30213 Self::ENCODED_LEN,
30214 __tmp.remaining(),
30215 )
30216 }
30217 __tmp.put_f32_le(self.sue_PITCHGAIN);
30218 __tmp.put_f32_le(self.sue_PITCHKD);
30219 __tmp.put_f32_le(self.sue_RUDDER_ELEV_MIX);
30220 __tmp.put_f32_le(self.sue_ROLL_ELEV_MIX);
30221 __tmp.put_f32_le(self.sue_ELEVATOR_BOOST);
30222 if matches!(version, MavlinkVersion::V2) {
30223 let len = __tmp.len();
30224 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30225 } else {
30226 __tmp.len()
30227 }
30228 }
30229}
30230#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F7: format."]
30231#[doc = ""]
30232#[doc = "ID: 175"]
30233#[derive(Debug, Clone, PartialEq)]
30234#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30235#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30236#[cfg_attr(feature = "ts", derive(TS))]
30237#[cfg_attr(feature = "ts", ts(export))]
30238pub struct SERIAL_UDB_EXTRA_F7_DATA {
30239 #[doc = "Serial UDB YAWKP_RUDDER Gain for Proporional control of navigation"]
30240 pub sue_YAWKP_RUDDER: f32,
30241 #[doc = "Serial UDB YAWKD_RUDDER Gain for Rate control of navigation"]
30242 pub sue_YAWKD_RUDDER: f32,
30243 #[doc = "Serial UDB Extra ROLLKP_RUDDER Gain for Proportional control of roll stabilization"]
30244 pub sue_ROLLKP_RUDDER: f32,
30245 #[doc = "Serial UDB Extra ROLLKD_RUDDER Gain for Rate control of roll stabilization"]
30246 pub sue_ROLLKD_RUDDER: f32,
30247 #[doc = "SERIAL UDB EXTRA Rudder Boost Gain to Manual Control when stabilized"]
30248 pub sue_RUDDER_BOOST: f32,
30249 #[doc = "Serial UDB Extra Return To Landing - Angle to Pitch Plane Down"]
30250 pub sue_RTL_PITCH_DOWN: f32,
30251}
30252impl SERIAL_UDB_EXTRA_F7_DATA {
30253 pub const ENCODED_LEN: usize = 24usize;
30254 pub const DEFAULT: Self = Self {
30255 sue_YAWKP_RUDDER: 0.0_f32,
30256 sue_YAWKD_RUDDER: 0.0_f32,
30257 sue_ROLLKP_RUDDER: 0.0_f32,
30258 sue_ROLLKD_RUDDER: 0.0_f32,
30259 sue_RUDDER_BOOST: 0.0_f32,
30260 sue_RTL_PITCH_DOWN: 0.0_f32,
30261 };
30262 #[cfg(feature = "arbitrary")]
30263 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30264 use arbitrary::{Arbitrary, Unstructured};
30265 let mut buf = [0u8; 1024];
30266 rng.fill_bytes(&mut buf);
30267 let mut unstructured = Unstructured::new(&buf);
30268 Self::arbitrary(&mut unstructured).unwrap_or_default()
30269 }
30270}
30271impl Default for SERIAL_UDB_EXTRA_F7_DATA {
30272 fn default() -> Self {
30273 Self::DEFAULT.clone()
30274 }
30275}
30276impl MessageData for SERIAL_UDB_EXTRA_F7_DATA {
30277 type Message = MavMessage;
30278 const ID: u32 = 175u32;
30279 const NAME: &'static str = "SERIAL_UDB_EXTRA_F7";
30280 const EXTRA_CRC: u8 = 171u8;
30281 const ENCODED_LEN: usize = 24usize;
30282 fn deser(
30283 _version: MavlinkVersion,
30284 __input: &[u8],
30285 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30286 let avail_len = __input.len();
30287 let mut payload_buf = [0; Self::ENCODED_LEN];
30288 let mut buf = if avail_len < Self::ENCODED_LEN {
30289 payload_buf[0..avail_len].copy_from_slice(__input);
30290 Bytes::new(&payload_buf)
30291 } else {
30292 Bytes::new(__input)
30293 };
30294 let mut __struct = Self::default();
30295 __struct.sue_YAWKP_RUDDER = buf.get_f32_le();
30296 __struct.sue_YAWKD_RUDDER = buf.get_f32_le();
30297 __struct.sue_ROLLKP_RUDDER = buf.get_f32_le();
30298 __struct.sue_ROLLKD_RUDDER = buf.get_f32_le();
30299 __struct.sue_RUDDER_BOOST = buf.get_f32_le();
30300 __struct.sue_RTL_PITCH_DOWN = buf.get_f32_le();
30301 Ok(__struct)
30302 }
30303 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30304 let mut __tmp = BytesMut::new(bytes);
30305 #[allow(clippy::absurd_extreme_comparisons)]
30306 #[allow(unused_comparisons)]
30307 if __tmp.remaining() < Self::ENCODED_LEN {
30308 panic!(
30309 "buffer is too small (need {} bytes, but got {})",
30310 Self::ENCODED_LEN,
30311 __tmp.remaining(),
30312 )
30313 }
30314 __tmp.put_f32_le(self.sue_YAWKP_RUDDER);
30315 __tmp.put_f32_le(self.sue_YAWKD_RUDDER);
30316 __tmp.put_f32_le(self.sue_ROLLKP_RUDDER);
30317 __tmp.put_f32_le(self.sue_ROLLKD_RUDDER);
30318 __tmp.put_f32_le(self.sue_RUDDER_BOOST);
30319 __tmp.put_f32_le(self.sue_RTL_PITCH_DOWN);
30320 if matches!(version, MavlinkVersion::V2) {
30321 let len = __tmp.len();
30322 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30323 } else {
30324 __tmp.len()
30325 }
30326 }
30327}
30328#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F8: format."]
30329#[doc = ""]
30330#[doc = "ID: 176"]
30331#[derive(Debug, Clone, PartialEq)]
30332#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30333#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30334#[cfg_attr(feature = "ts", derive(TS))]
30335#[cfg_attr(feature = "ts", ts(export))]
30336pub struct SERIAL_UDB_EXTRA_F8_DATA {
30337 #[doc = "Serial UDB Extra HEIGHT_TARGET_MAX"]
30338 pub sue_HEIGHT_TARGET_MAX: f32,
30339 #[doc = "Serial UDB Extra HEIGHT_TARGET_MIN"]
30340 pub sue_HEIGHT_TARGET_MIN: f32,
30341 #[doc = "Serial UDB Extra ALT_HOLD_THROTTLE_MIN"]
30342 pub sue_ALT_HOLD_THROTTLE_MIN: f32,
30343 #[doc = "Serial UDB Extra ALT_HOLD_THROTTLE_MAX"]
30344 pub sue_ALT_HOLD_THROTTLE_MAX: f32,
30345 #[doc = "Serial UDB Extra ALT_HOLD_PITCH_MIN"]
30346 pub sue_ALT_HOLD_PITCH_MIN: f32,
30347 #[doc = "Serial UDB Extra ALT_HOLD_PITCH_MAX"]
30348 pub sue_ALT_HOLD_PITCH_MAX: f32,
30349 #[doc = "Serial UDB Extra ALT_HOLD_PITCH_HIGH"]
30350 pub sue_ALT_HOLD_PITCH_HIGH: f32,
30351}
30352impl SERIAL_UDB_EXTRA_F8_DATA {
30353 pub const ENCODED_LEN: usize = 28usize;
30354 pub const DEFAULT: Self = Self {
30355 sue_HEIGHT_TARGET_MAX: 0.0_f32,
30356 sue_HEIGHT_TARGET_MIN: 0.0_f32,
30357 sue_ALT_HOLD_THROTTLE_MIN: 0.0_f32,
30358 sue_ALT_HOLD_THROTTLE_MAX: 0.0_f32,
30359 sue_ALT_HOLD_PITCH_MIN: 0.0_f32,
30360 sue_ALT_HOLD_PITCH_MAX: 0.0_f32,
30361 sue_ALT_HOLD_PITCH_HIGH: 0.0_f32,
30362 };
30363 #[cfg(feature = "arbitrary")]
30364 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30365 use arbitrary::{Arbitrary, Unstructured};
30366 let mut buf = [0u8; 1024];
30367 rng.fill_bytes(&mut buf);
30368 let mut unstructured = Unstructured::new(&buf);
30369 Self::arbitrary(&mut unstructured).unwrap_or_default()
30370 }
30371}
30372impl Default for SERIAL_UDB_EXTRA_F8_DATA {
30373 fn default() -> Self {
30374 Self::DEFAULT.clone()
30375 }
30376}
30377impl MessageData for SERIAL_UDB_EXTRA_F8_DATA {
30378 type Message = MavMessage;
30379 const ID: u32 = 176u32;
30380 const NAME: &'static str = "SERIAL_UDB_EXTRA_F8";
30381 const EXTRA_CRC: u8 = 142u8;
30382 const ENCODED_LEN: usize = 28usize;
30383 fn deser(
30384 _version: MavlinkVersion,
30385 __input: &[u8],
30386 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30387 let avail_len = __input.len();
30388 let mut payload_buf = [0; Self::ENCODED_LEN];
30389 let mut buf = if avail_len < Self::ENCODED_LEN {
30390 payload_buf[0..avail_len].copy_from_slice(__input);
30391 Bytes::new(&payload_buf)
30392 } else {
30393 Bytes::new(__input)
30394 };
30395 let mut __struct = Self::default();
30396 __struct.sue_HEIGHT_TARGET_MAX = buf.get_f32_le();
30397 __struct.sue_HEIGHT_TARGET_MIN = buf.get_f32_le();
30398 __struct.sue_ALT_HOLD_THROTTLE_MIN = buf.get_f32_le();
30399 __struct.sue_ALT_HOLD_THROTTLE_MAX = buf.get_f32_le();
30400 __struct.sue_ALT_HOLD_PITCH_MIN = buf.get_f32_le();
30401 __struct.sue_ALT_HOLD_PITCH_MAX = buf.get_f32_le();
30402 __struct.sue_ALT_HOLD_PITCH_HIGH = buf.get_f32_le();
30403 Ok(__struct)
30404 }
30405 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30406 let mut __tmp = BytesMut::new(bytes);
30407 #[allow(clippy::absurd_extreme_comparisons)]
30408 #[allow(unused_comparisons)]
30409 if __tmp.remaining() < Self::ENCODED_LEN {
30410 panic!(
30411 "buffer is too small (need {} bytes, but got {})",
30412 Self::ENCODED_LEN,
30413 __tmp.remaining(),
30414 )
30415 }
30416 __tmp.put_f32_le(self.sue_HEIGHT_TARGET_MAX);
30417 __tmp.put_f32_le(self.sue_HEIGHT_TARGET_MIN);
30418 __tmp.put_f32_le(self.sue_ALT_HOLD_THROTTLE_MIN);
30419 __tmp.put_f32_le(self.sue_ALT_HOLD_THROTTLE_MAX);
30420 __tmp.put_f32_le(self.sue_ALT_HOLD_PITCH_MIN);
30421 __tmp.put_f32_le(self.sue_ALT_HOLD_PITCH_MAX);
30422 __tmp.put_f32_le(self.sue_ALT_HOLD_PITCH_HIGH);
30423 if matches!(version, MavlinkVersion::V2) {
30424 let len = __tmp.len();
30425 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30426 } else {
30427 __tmp.len()
30428 }
30429 }
30430}
30431#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
30432#[doc = ""]
30433#[doc = "ID: 36"]
30434#[derive(Debug, Clone, PartialEq)]
30435#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30436#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30437#[cfg_attr(feature = "ts", derive(TS))]
30438#[cfg_attr(feature = "ts", ts(export))]
30439pub struct SERVO_OUTPUT_RAW_DATA {
30440 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30441 pub time_usec: u32,
30442 #[doc = "Servo output 1 value"]
30443 pub servo1_raw: u16,
30444 #[doc = "Servo output 2 value"]
30445 pub servo2_raw: u16,
30446 #[doc = "Servo output 3 value"]
30447 pub servo3_raw: u16,
30448 #[doc = "Servo output 4 value"]
30449 pub servo4_raw: u16,
30450 #[doc = "Servo output 5 value"]
30451 pub servo5_raw: u16,
30452 #[doc = "Servo output 6 value"]
30453 pub servo6_raw: u16,
30454 #[doc = "Servo output 7 value"]
30455 pub servo7_raw: u16,
30456 #[doc = "Servo output 8 value"]
30457 pub servo8_raw: u16,
30458 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
30459 pub port: u8,
30460 #[doc = "Servo output 9 value"]
30461 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30462 pub servo9_raw: u16,
30463 #[doc = "Servo output 10 value"]
30464 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30465 pub servo10_raw: u16,
30466 #[doc = "Servo output 11 value"]
30467 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30468 pub servo11_raw: u16,
30469 #[doc = "Servo output 12 value"]
30470 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30471 pub servo12_raw: u16,
30472 #[doc = "Servo output 13 value"]
30473 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30474 pub servo13_raw: u16,
30475 #[doc = "Servo output 14 value"]
30476 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30477 pub servo14_raw: u16,
30478 #[doc = "Servo output 15 value"]
30479 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30480 pub servo15_raw: u16,
30481 #[doc = "Servo output 16 value"]
30482 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30483 pub servo16_raw: u16,
30484}
30485impl SERVO_OUTPUT_RAW_DATA {
30486 pub const ENCODED_LEN: usize = 37usize;
30487 pub const DEFAULT: Self = Self {
30488 time_usec: 0_u32,
30489 servo1_raw: 0_u16,
30490 servo2_raw: 0_u16,
30491 servo3_raw: 0_u16,
30492 servo4_raw: 0_u16,
30493 servo5_raw: 0_u16,
30494 servo6_raw: 0_u16,
30495 servo7_raw: 0_u16,
30496 servo8_raw: 0_u16,
30497 port: 0_u8,
30498 servo9_raw: 0_u16,
30499 servo10_raw: 0_u16,
30500 servo11_raw: 0_u16,
30501 servo12_raw: 0_u16,
30502 servo13_raw: 0_u16,
30503 servo14_raw: 0_u16,
30504 servo15_raw: 0_u16,
30505 servo16_raw: 0_u16,
30506 };
30507 #[cfg(feature = "arbitrary")]
30508 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30509 use arbitrary::{Arbitrary, Unstructured};
30510 let mut buf = [0u8; 1024];
30511 rng.fill_bytes(&mut buf);
30512 let mut unstructured = Unstructured::new(&buf);
30513 Self::arbitrary(&mut unstructured).unwrap_or_default()
30514 }
30515}
30516impl Default for SERVO_OUTPUT_RAW_DATA {
30517 fn default() -> Self {
30518 Self::DEFAULT.clone()
30519 }
30520}
30521impl MessageData for SERVO_OUTPUT_RAW_DATA {
30522 type Message = MavMessage;
30523 const ID: u32 = 36u32;
30524 const NAME: &'static str = "SERVO_OUTPUT_RAW";
30525 const EXTRA_CRC: u8 = 222u8;
30526 const ENCODED_LEN: usize = 37usize;
30527 fn deser(
30528 _version: MavlinkVersion,
30529 __input: &[u8],
30530 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30531 let avail_len = __input.len();
30532 let mut payload_buf = [0; Self::ENCODED_LEN];
30533 let mut buf = if avail_len < Self::ENCODED_LEN {
30534 payload_buf[0..avail_len].copy_from_slice(__input);
30535 Bytes::new(&payload_buf)
30536 } else {
30537 Bytes::new(__input)
30538 };
30539 let mut __struct = Self::default();
30540 __struct.time_usec = buf.get_u32_le();
30541 __struct.servo1_raw = buf.get_u16_le();
30542 __struct.servo2_raw = buf.get_u16_le();
30543 __struct.servo3_raw = buf.get_u16_le();
30544 __struct.servo4_raw = buf.get_u16_le();
30545 __struct.servo5_raw = buf.get_u16_le();
30546 __struct.servo6_raw = buf.get_u16_le();
30547 __struct.servo7_raw = buf.get_u16_le();
30548 __struct.servo8_raw = buf.get_u16_le();
30549 __struct.port = buf.get_u8();
30550 __struct.servo9_raw = buf.get_u16_le();
30551 __struct.servo10_raw = buf.get_u16_le();
30552 __struct.servo11_raw = buf.get_u16_le();
30553 __struct.servo12_raw = buf.get_u16_le();
30554 __struct.servo13_raw = buf.get_u16_le();
30555 __struct.servo14_raw = buf.get_u16_le();
30556 __struct.servo15_raw = buf.get_u16_le();
30557 __struct.servo16_raw = buf.get_u16_le();
30558 Ok(__struct)
30559 }
30560 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30561 let mut __tmp = BytesMut::new(bytes);
30562 #[allow(clippy::absurd_extreme_comparisons)]
30563 #[allow(unused_comparisons)]
30564 if __tmp.remaining() < Self::ENCODED_LEN {
30565 panic!(
30566 "buffer is too small (need {} bytes, but got {})",
30567 Self::ENCODED_LEN,
30568 __tmp.remaining(),
30569 )
30570 }
30571 __tmp.put_u32_le(self.time_usec);
30572 __tmp.put_u16_le(self.servo1_raw);
30573 __tmp.put_u16_le(self.servo2_raw);
30574 __tmp.put_u16_le(self.servo3_raw);
30575 __tmp.put_u16_le(self.servo4_raw);
30576 __tmp.put_u16_le(self.servo5_raw);
30577 __tmp.put_u16_le(self.servo6_raw);
30578 __tmp.put_u16_le(self.servo7_raw);
30579 __tmp.put_u16_le(self.servo8_raw);
30580 __tmp.put_u8(self.port);
30581 if matches!(version, MavlinkVersion::V2) {
30582 __tmp.put_u16_le(self.servo9_raw);
30583 __tmp.put_u16_le(self.servo10_raw);
30584 __tmp.put_u16_le(self.servo11_raw);
30585 __tmp.put_u16_le(self.servo12_raw);
30586 __tmp.put_u16_le(self.servo13_raw);
30587 __tmp.put_u16_le(self.servo14_raw);
30588 __tmp.put_u16_le(self.servo15_raw);
30589 __tmp.put_u16_le(self.servo16_raw);
30590 let len = __tmp.len();
30591 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30592 } else {
30593 __tmp.len()
30594 }
30595 }
30596}
30597#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
30598#[doc = ""]
30599#[doc = "ID: 256"]
30600#[derive(Debug, Clone, PartialEq)]
30601#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30602#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30603#[cfg_attr(feature = "ts", derive(TS))]
30604#[cfg_attr(feature = "ts", ts(export))]
30605pub struct SETUP_SIGNING_DATA {
30606 #[doc = "initial timestamp"]
30607 pub initial_timestamp: u64,
30608 #[doc = "system id of the target"]
30609 pub target_system: u8,
30610 #[doc = "component ID of the target"]
30611 pub target_component: u8,
30612 #[doc = "signing key"]
30613 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30614 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30615 pub secret_key: [u8; 32],
30616}
30617impl SETUP_SIGNING_DATA {
30618 pub const ENCODED_LEN: usize = 42usize;
30619 pub const DEFAULT: Self = Self {
30620 initial_timestamp: 0_u64,
30621 target_system: 0_u8,
30622 target_component: 0_u8,
30623 secret_key: [0_u8; 32usize],
30624 };
30625 #[cfg(feature = "arbitrary")]
30626 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30627 use arbitrary::{Arbitrary, Unstructured};
30628 let mut buf = [0u8; 1024];
30629 rng.fill_bytes(&mut buf);
30630 let mut unstructured = Unstructured::new(&buf);
30631 Self::arbitrary(&mut unstructured).unwrap_or_default()
30632 }
30633}
30634impl Default for SETUP_SIGNING_DATA {
30635 fn default() -> Self {
30636 Self::DEFAULT.clone()
30637 }
30638}
30639impl MessageData for SETUP_SIGNING_DATA {
30640 type Message = MavMessage;
30641 const ID: u32 = 256u32;
30642 const NAME: &'static str = "SETUP_SIGNING";
30643 const EXTRA_CRC: u8 = 71u8;
30644 const ENCODED_LEN: usize = 42usize;
30645 fn deser(
30646 _version: MavlinkVersion,
30647 __input: &[u8],
30648 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30649 let avail_len = __input.len();
30650 let mut payload_buf = [0; Self::ENCODED_LEN];
30651 let mut buf = if avail_len < Self::ENCODED_LEN {
30652 payload_buf[0..avail_len].copy_from_slice(__input);
30653 Bytes::new(&payload_buf)
30654 } else {
30655 Bytes::new(__input)
30656 };
30657 let mut __struct = Self::default();
30658 __struct.initial_timestamp = buf.get_u64_le();
30659 __struct.target_system = buf.get_u8();
30660 __struct.target_component = buf.get_u8();
30661 for v in &mut __struct.secret_key {
30662 let val = buf.get_u8();
30663 *v = val;
30664 }
30665 Ok(__struct)
30666 }
30667 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30668 let mut __tmp = BytesMut::new(bytes);
30669 #[allow(clippy::absurd_extreme_comparisons)]
30670 #[allow(unused_comparisons)]
30671 if __tmp.remaining() < Self::ENCODED_LEN {
30672 panic!(
30673 "buffer is too small (need {} bytes, but got {})",
30674 Self::ENCODED_LEN,
30675 __tmp.remaining(),
30676 )
30677 }
30678 __tmp.put_u64_le(self.initial_timestamp);
30679 __tmp.put_u8(self.target_system);
30680 __tmp.put_u8(self.target_component);
30681 for val in &self.secret_key {
30682 __tmp.put_u8(*val);
30683 }
30684 if matches!(version, MavlinkVersion::V2) {
30685 let len = __tmp.len();
30686 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30687 } else {
30688 __tmp.len()
30689 }
30690 }
30691}
30692#[doc = "Set the vehicle attitude and body angular rates."]
30693#[doc = ""]
30694#[doc = "ID: 139"]
30695#[derive(Debug, Clone, PartialEq)]
30696#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30697#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30698#[cfg_attr(feature = "ts", derive(TS))]
30699#[cfg_attr(feature = "ts", ts(export))]
30700pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
30701 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30702 pub time_usec: u64,
30703 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
30704 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30705 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30706 pub controls: [f32; 8],
30707 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
30708 pub group_mlx: u8,
30709 #[doc = "System ID"]
30710 pub target_system: u8,
30711 #[doc = "Component ID"]
30712 pub target_component: u8,
30713}
30714impl SET_ACTUATOR_CONTROL_TARGET_DATA {
30715 pub const ENCODED_LEN: usize = 43usize;
30716 pub const DEFAULT: Self = Self {
30717 time_usec: 0_u64,
30718 controls: [0.0_f32; 8usize],
30719 group_mlx: 0_u8,
30720 target_system: 0_u8,
30721 target_component: 0_u8,
30722 };
30723 #[cfg(feature = "arbitrary")]
30724 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30725 use arbitrary::{Arbitrary, Unstructured};
30726 let mut buf = [0u8; 1024];
30727 rng.fill_bytes(&mut buf);
30728 let mut unstructured = Unstructured::new(&buf);
30729 Self::arbitrary(&mut unstructured).unwrap_or_default()
30730 }
30731}
30732impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
30733 fn default() -> Self {
30734 Self::DEFAULT.clone()
30735 }
30736}
30737impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
30738 type Message = MavMessage;
30739 const ID: u32 = 139u32;
30740 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
30741 const EXTRA_CRC: u8 = 168u8;
30742 const ENCODED_LEN: usize = 43usize;
30743 fn deser(
30744 _version: MavlinkVersion,
30745 __input: &[u8],
30746 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30747 let avail_len = __input.len();
30748 let mut payload_buf = [0; Self::ENCODED_LEN];
30749 let mut buf = if avail_len < Self::ENCODED_LEN {
30750 payload_buf[0..avail_len].copy_from_slice(__input);
30751 Bytes::new(&payload_buf)
30752 } else {
30753 Bytes::new(__input)
30754 };
30755 let mut __struct = Self::default();
30756 __struct.time_usec = buf.get_u64_le();
30757 for v in &mut __struct.controls {
30758 let val = buf.get_f32_le();
30759 *v = val;
30760 }
30761 __struct.group_mlx = buf.get_u8();
30762 __struct.target_system = buf.get_u8();
30763 __struct.target_component = buf.get_u8();
30764 Ok(__struct)
30765 }
30766 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30767 let mut __tmp = BytesMut::new(bytes);
30768 #[allow(clippy::absurd_extreme_comparisons)]
30769 #[allow(unused_comparisons)]
30770 if __tmp.remaining() < Self::ENCODED_LEN {
30771 panic!(
30772 "buffer is too small (need {} bytes, but got {})",
30773 Self::ENCODED_LEN,
30774 __tmp.remaining(),
30775 )
30776 }
30777 __tmp.put_u64_le(self.time_usec);
30778 for val in &self.controls {
30779 __tmp.put_f32_le(*val);
30780 }
30781 __tmp.put_u8(self.group_mlx);
30782 __tmp.put_u8(self.target_system);
30783 __tmp.put_u8(self.target_component);
30784 if matches!(version, MavlinkVersion::V2) {
30785 let len = __tmp.len();
30786 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30787 } else {
30788 __tmp.len()
30789 }
30790 }
30791}
30792#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
30793#[doc = ""]
30794#[doc = "ID: 82"]
30795#[derive(Debug, Clone, PartialEq)]
30796#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30797#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30798#[cfg_attr(feature = "ts", derive(TS))]
30799#[cfg_attr(feature = "ts", ts(export))]
30800pub struct SET_ATTITUDE_TARGET_DATA {
30801 #[doc = "Timestamp (time since system boot)."]
30802 pub time_boot_ms: u32,
30803 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
30804 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30805 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30806 pub q: [f32; 4],
30807 #[doc = "Body roll rate"]
30808 pub body_roll_rate: f32,
30809 #[doc = "Body pitch rate"]
30810 pub body_pitch_rate: f32,
30811 #[doc = "Body yaw rate"]
30812 pub body_yaw_rate: f32,
30813 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
30814 pub thrust: f32,
30815 #[doc = "System ID"]
30816 pub target_system: u8,
30817 #[doc = "Component ID"]
30818 pub target_component: u8,
30819 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
30820 pub type_mask: AttitudeTargetTypemask,
30821 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
30822 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30823 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30824 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30825 pub thrust_body: [f32; 3],
30826}
30827impl SET_ATTITUDE_TARGET_DATA {
30828 pub const ENCODED_LEN: usize = 51usize;
30829 pub const DEFAULT: Self = Self {
30830 time_boot_ms: 0_u32,
30831 q: [0.0_f32; 4usize],
30832 body_roll_rate: 0.0_f32,
30833 body_pitch_rate: 0.0_f32,
30834 body_yaw_rate: 0.0_f32,
30835 thrust: 0.0_f32,
30836 target_system: 0_u8,
30837 target_component: 0_u8,
30838 type_mask: AttitudeTargetTypemask::DEFAULT,
30839 thrust_body: [0.0_f32; 3usize],
30840 };
30841 #[cfg(feature = "arbitrary")]
30842 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30843 use arbitrary::{Arbitrary, Unstructured};
30844 let mut buf = [0u8; 1024];
30845 rng.fill_bytes(&mut buf);
30846 let mut unstructured = Unstructured::new(&buf);
30847 Self::arbitrary(&mut unstructured).unwrap_or_default()
30848 }
30849}
30850impl Default for SET_ATTITUDE_TARGET_DATA {
30851 fn default() -> Self {
30852 Self::DEFAULT.clone()
30853 }
30854}
30855impl MessageData for SET_ATTITUDE_TARGET_DATA {
30856 type Message = MavMessage;
30857 const ID: u32 = 82u32;
30858 const NAME: &'static str = "SET_ATTITUDE_TARGET";
30859 const EXTRA_CRC: u8 = 49u8;
30860 const ENCODED_LEN: usize = 51usize;
30861 fn deser(
30862 _version: MavlinkVersion,
30863 __input: &[u8],
30864 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30865 let avail_len = __input.len();
30866 let mut payload_buf = [0; Self::ENCODED_LEN];
30867 let mut buf = if avail_len < Self::ENCODED_LEN {
30868 payload_buf[0..avail_len].copy_from_slice(__input);
30869 Bytes::new(&payload_buf)
30870 } else {
30871 Bytes::new(__input)
30872 };
30873 let mut __struct = Self::default();
30874 __struct.time_boot_ms = buf.get_u32_le();
30875 for v in &mut __struct.q {
30876 let val = buf.get_f32_le();
30877 *v = val;
30878 }
30879 __struct.body_roll_rate = buf.get_f32_le();
30880 __struct.body_pitch_rate = buf.get_f32_le();
30881 __struct.body_yaw_rate = buf.get_f32_le();
30882 __struct.thrust = buf.get_f32_le();
30883 __struct.target_system = buf.get_u8();
30884 __struct.target_component = buf.get_u8();
30885 let tmp = buf.get_u8();
30886 __struct.type_mask = AttitudeTargetTypemask::from_bits(
30887 tmp & AttitudeTargetTypemask::all().bits(),
30888 )
30889 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30890 flag_type: "AttitudeTargetTypemask",
30891 value: tmp as u32,
30892 })?;
30893 for v in &mut __struct.thrust_body {
30894 let val = buf.get_f32_le();
30895 *v = val;
30896 }
30897 Ok(__struct)
30898 }
30899 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30900 let mut __tmp = BytesMut::new(bytes);
30901 #[allow(clippy::absurd_extreme_comparisons)]
30902 #[allow(unused_comparisons)]
30903 if __tmp.remaining() < Self::ENCODED_LEN {
30904 panic!(
30905 "buffer is too small (need {} bytes, but got {})",
30906 Self::ENCODED_LEN,
30907 __tmp.remaining(),
30908 )
30909 }
30910 __tmp.put_u32_le(self.time_boot_ms);
30911 for val in &self.q {
30912 __tmp.put_f32_le(*val);
30913 }
30914 __tmp.put_f32_le(self.body_roll_rate);
30915 __tmp.put_f32_le(self.body_pitch_rate);
30916 __tmp.put_f32_le(self.body_yaw_rate);
30917 __tmp.put_f32_le(self.thrust);
30918 __tmp.put_u8(self.target_system);
30919 __tmp.put_u8(self.target_component);
30920 __tmp.put_u8(self.type_mask.bits());
30921 if matches!(version, MavlinkVersion::V2) {
30922 for val in &self.thrust_body {
30923 __tmp.put_f32_le(*val);
30924 }
30925 let len = __tmp.len();
30926 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30927 } else {
30928 __tmp.len()
30929 }
30930 }
30931}
30932#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
30933#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
30934#[doc = ""]
30935#[doc = "ID: 48"]
30936#[derive(Debug, Clone, PartialEq)]
30937#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30938#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30939#[cfg_attr(feature = "ts", derive(TS))]
30940#[cfg_attr(feature = "ts", ts(export))]
30941pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
30942 #[doc = "Latitude (WGS84)"]
30943 pub latitude: i32,
30944 #[doc = "Longitude (WGS84)"]
30945 pub longitude: i32,
30946 #[doc = "Altitude (MSL). Positive for up."]
30947 pub altitude: i32,
30948 #[doc = "System ID"]
30949 pub target_system: u8,
30950 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30951 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30952 pub time_usec: u64,
30953}
30954impl SET_GPS_GLOBAL_ORIGIN_DATA {
30955 pub const ENCODED_LEN: usize = 21usize;
30956 pub const DEFAULT: Self = Self {
30957 latitude: 0_i32,
30958 longitude: 0_i32,
30959 altitude: 0_i32,
30960 target_system: 0_u8,
30961 time_usec: 0_u64,
30962 };
30963 #[cfg(feature = "arbitrary")]
30964 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30965 use arbitrary::{Arbitrary, Unstructured};
30966 let mut buf = [0u8; 1024];
30967 rng.fill_bytes(&mut buf);
30968 let mut unstructured = Unstructured::new(&buf);
30969 Self::arbitrary(&mut unstructured).unwrap_or_default()
30970 }
30971}
30972impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
30973 fn default() -> Self {
30974 Self::DEFAULT.clone()
30975 }
30976}
30977impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
30978 type Message = MavMessage;
30979 const ID: u32 = 48u32;
30980 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
30981 const EXTRA_CRC: u8 = 41u8;
30982 const ENCODED_LEN: usize = 21usize;
30983 fn deser(
30984 _version: MavlinkVersion,
30985 __input: &[u8],
30986 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30987 let avail_len = __input.len();
30988 let mut payload_buf = [0; Self::ENCODED_LEN];
30989 let mut buf = if avail_len < Self::ENCODED_LEN {
30990 payload_buf[0..avail_len].copy_from_slice(__input);
30991 Bytes::new(&payload_buf)
30992 } else {
30993 Bytes::new(__input)
30994 };
30995 let mut __struct = Self::default();
30996 __struct.latitude = buf.get_i32_le();
30997 __struct.longitude = buf.get_i32_le();
30998 __struct.altitude = buf.get_i32_le();
30999 __struct.target_system = buf.get_u8();
31000 __struct.time_usec = buf.get_u64_le();
31001 Ok(__struct)
31002 }
31003 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31004 let mut __tmp = BytesMut::new(bytes);
31005 #[allow(clippy::absurd_extreme_comparisons)]
31006 #[allow(unused_comparisons)]
31007 if __tmp.remaining() < Self::ENCODED_LEN {
31008 panic!(
31009 "buffer is too small (need {} bytes, but got {})",
31010 Self::ENCODED_LEN,
31011 __tmp.remaining(),
31012 )
31013 }
31014 __tmp.put_i32_le(self.latitude);
31015 __tmp.put_i32_le(self.longitude);
31016 __tmp.put_i32_le(self.altitude);
31017 __tmp.put_u8(self.target_system);
31018 if matches!(version, MavlinkVersion::V2) {
31019 __tmp.put_u64_le(self.time_usec);
31020 let len = __tmp.len();
31021 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31022 } else {
31023 __tmp.len()
31024 }
31025 }
31026}
31027#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
31028#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
31029#[doc = ""]
31030#[doc = "ID: 243"]
31031#[derive(Debug, Clone, PartialEq)]
31032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31034#[cfg_attr(feature = "ts", derive(TS))]
31035#[cfg_attr(feature = "ts", ts(export))]
31036pub struct SET_HOME_POSITION_DATA {
31037 #[doc = "Latitude (WGS84)"]
31038 pub latitude: i32,
31039 #[doc = "Longitude (WGS84)"]
31040 pub longitude: i32,
31041 #[doc = "Altitude (MSL). Positive for up."]
31042 pub altitude: i32,
31043 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
31044 pub x: f32,
31045 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
31046 pub y: f32,
31047 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
31048 pub z: f32,
31049 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
31050 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31051 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31052 pub q: [f32; 4],
31053 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
31054 pub approach_x: f32,
31055 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
31056 pub approach_y: f32,
31057 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
31058 pub approach_z: f32,
31059 #[doc = "System ID."]
31060 pub target_system: u8,
31061 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31062 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31063 pub time_usec: u64,
31064}
31065impl SET_HOME_POSITION_DATA {
31066 pub const ENCODED_LEN: usize = 61usize;
31067 pub const DEFAULT: Self = Self {
31068 latitude: 0_i32,
31069 longitude: 0_i32,
31070 altitude: 0_i32,
31071 x: 0.0_f32,
31072 y: 0.0_f32,
31073 z: 0.0_f32,
31074 q: [0.0_f32; 4usize],
31075 approach_x: 0.0_f32,
31076 approach_y: 0.0_f32,
31077 approach_z: 0.0_f32,
31078 target_system: 0_u8,
31079 time_usec: 0_u64,
31080 };
31081 #[cfg(feature = "arbitrary")]
31082 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31083 use arbitrary::{Arbitrary, Unstructured};
31084 let mut buf = [0u8; 1024];
31085 rng.fill_bytes(&mut buf);
31086 let mut unstructured = Unstructured::new(&buf);
31087 Self::arbitrary(&mut unstructured).unwrap_or_default()
31088 }
31089}
31090impl Default for SET_HOME_POSITION_DATA {
31091 fn default() -> Self {
31092 Self::DEFAULT.clone()
31093 }
31094}
31095impl MessageData for SET_HOME_POSITION_DATA {
31096 type Message = MavMessage;
31097 const ID: u32 = 243u32;
31098 const NAME: &'static str = "SET_HOME_POSITION";
31099 const EXTRA_CRC: u8 = 85u8;
31100 const ENCODED_LEN: usize = 61usize;
31101 fn deser(
31102 _version: MavlinkVersion,
31103 __input: &[u8],
31104 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31105 let avail_len = __input.len();
31106 let mut payload_buf = [0; Self::ENCODED_LEN];
31107 let mut buf = if avail_len < Self::ENCODED_LEN {
31108 payload_buf[0..avail_len].copy_from_slice(__input);
31109 Bytes::new(&payload_buf)
31110 } else {
31111 Bytes::new(__input)
31112 };
31113 let mut __struct = Self::default();
31114 __struct.latitude = buf.get_i32_le();
31115 __struct.longitude = buf.get_i32_le();
31116 __struct.altitude = buf.get_i32_le();
31117 __struct.x = buf.get_f32_le();
31118 __struct.y = buf.get_f32_le();
31119 __struct.z = buf.get_f32_le();
31120 for v in &mut __struct.q {
31121 let val = buf.get_f32_le();
31122 *v = val;
31123 }
31124 __struct.approach_x = buf.get_f32_le();
31125 __struct.approach_y = buf.get_f32_le();
31126 __struct.approach_z = buf.get_f32_le();
31127 __struct.target_system = buf.get_u8();
31128 __struct.time_usec = buf.get_u64_le();
31129 Ok(__struct)
31130 }
31131 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31132 let mut __tmp = BytesMut::new(bytes);
31133 #[allow(clippy::absurd_extreme_comparisons)]
31134 #[allow(unused_comparisons)]
31135 if __tmp.remaining() < Self::ENCODED_LEN {
31136 panic!(
31137 "buffer is too small (need {} bytes, but got {})",
31138 Self::ENCODED_LEN,
31139 __tmp.remaining(),
31140 )
31141 }
31142 __tmp.put_i32_le(self.latitude);
31143 __tmp.put_i32_le(self.longitude);
31144 __tmp.put_i32_le(self.altitude);
31145 __tmp.put_f32_le(self.x);
31146 __tmp.put_f32_le(self.y);
31147 __tmp.put_f32_le(self.z);
31148 for val in &self.q {
31149 __tmp.put_f32_le(*val);
31150 }
31151 __tmp.put_f32_le(self.approach_x);
31152 __tmp.put_f32_le(self.approach_y);
31153 __tmp.put_f32_le(self.approach_z);
31154 __tmp.put_u8(self.target_system);
31155 if matches!(version, MavlinkVersion::V2) {
31156 __tmp.put_u64_le(self.time_usec);
31157 let len = __tmp.len();
31158 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31159 } else {
31160 __tmp.len()
31161 }
31162 }
31163}
31164#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
31165#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
31166#[doc = ""]
31167#[doc = "ID: 11"]
31168#[derive(Debug, Clone, PartialEq)]
31169#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31170#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31171#[cfg_attr(feature = "ts", derive(TS))]
31172#[cfg_attr(feature = "ts", ts(export))]
31173pub struct SET_MODE_DATA {
31174 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
31175 pub custom_mode: u32,
31176 #[doc = "The system setting the mode"]
31177 pub target_system: u8,
31178 #[doc = "The new base mode."]
31179 pub base_mode: MavMode,
31180}
31181impl SET_MODE_DATA {
31182 pub const ENCODED_LEN: usize = 6usize;
31183 pub const DEFAULT: Self = Self {
31184 custom_mode: 0_u32,
31185 target_system: 0_u8,
31186 base_mode: MavMode::DEFAULT,
31187 };
31188 #[cfg(feature = "arbitrary")]
31189 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31190 use arbitrary::{Arbitrary, Unstructured};
31191 let mut buf = [0u8; 1024];
31192 rng.fill_bytes(&mut buf);
31193 let mut unstructured = Unstructured::new(&buf);
31194 Self::arbitrary(&mut unstructured).unwrap_or_default()
31195 }
31196}
31197impl Default for SET_MODE_DATA {
31198 fn default() -> Self {
31199 Self::DEFAULT.clone()
31200 }
31201}
31202impl MessageData for SET_MODE_DATA {
31203 type Message = MavMessage;
31204 const ID: u32 = 11u32;
31205 const NAME: &'static str = "SET_MODE";
31206 const EXTRA_CRC: u8 = 89u8;
31207 const ENCODED_LEN: usize = 6usize;
31208 fn deser(
31209 _version: MavlinkVersion,
31210 __input: &[u8],
31211 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31212 let avail_len = __input.len();
31213 let mut payload_buf = [0; Self::ENCODED_LEN];
31214 let mut buf = if avail_len < Self::ENCODED_LEN {
31215 payload_buf[0..avail_len].copy_from_slice(__input);
31216 Bytes::new(&payload_buf)
31217 } else {
31218 Bytes::new(__input)
31219 };
31220 let mut __struct = Self::default();
31221 __struct.custom_mode = buf.get_u32_le();
31222 __struct.target_system = buf.get_u8();
31223 let tmp = buf.get_u8();
31224 __struct.base_mode =
31225 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31226 enum_type: "MavMode",
31227 value: tmp as u32,
31228 })?;
31229 Ok(__struct)
31230 }
31231 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31232 let mut __tmp = BytesMut::new(bytes);
31233 #[allow(clippy::absurd_extreme_comparisons)]
31234 #[allow(unused_comparisons)]
31235 if __tmp.remaining() < Self::ENCODED_LEN {
31236 panic!(
31237 "buffer is too small (need {} bytes, but got {})",
31238 Self::ENCODED_LEN,
31239 __tmp.remaining(),
31240 )
31241 }
31242 __tmp.put_u32_le(self.custom_mode);
31243 __tmp.put_u8(self.target_system);
31244 __tmp.put_u8(self.base_mode as u8);
31245 if matches!(version, MavlinkVersion::V2) {
31246 let len = __tmp.len();
31247 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31248 } else {
31249 __tmp.len()
31250 }
31251 }
31252}
31253#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
31254#[doc = ""]
31255#[doc = "ID: 86"]
31256#[derive(Debug, Clone, PartialEq)]
31257#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31258#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31259#[cfg_attr(feature = "ts", derive(TS))]
31260#[cfg_attr(feature = "ts", ts(export))]
31261pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
31262 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
31263 pub time_boot_ms: u32,
31264 #[doc = "Latitude in WGS84 frame"]
31265 pub lat_int: i32,
31266 #[doc = "Longitude in WGS84 frame"]
31267 pub lon_int: i32,
31268 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
31269 pub alt: f32,
31270 #[doc = "X velocity in NED frame"]
31271 pub vx: f32,
31272 #[doc = "Y velocity in NED frame"]
31273 pub vy: f32,
31274 #[doc = "Z velocity in NED frame"]
31275 pub vz: f32,
31276 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
31277 pub afx: f32,
31278 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
31279 pub afy: f32,
31280 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
31281 pub afz: f32,
31282 #[doc = "yaw setpoint"]
31283 pub yaw: f32,
31284 #[doc = "yaw rate setpoint"]
31285 pub yaw_rate: f32,
31286 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
31287 pub type_mask: PositionTargetTypemask,
31288 #[doc = "System ID"]
31289 pub target_system: u8,
31290 #[doc = "Component ID"]
31291 pub target_component: u8,
31292 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
31293 pub coordinate_frame: MavFrame,
31294}
31295impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
31296 pub const ENCODED_LEN: usize = 53usize;
31297 pub const DEFAULT: Self = Self {
31298 time_boot_ms: 0_u32,
31299 lat_int: 0_i32,
31300 lon_int: 0_i32,
31301 alt: 0.0_f32,
31302 vx: 0.0_f32,
31303 vy: 0.0_f32,
31304 vz: 0.0_f32,
31305 afx: 0.0_f32,
31306 afy: 0.0_f32,
31307 afz: 0.0_f32,
31308 yaw: 0.0_f32,
31309 yaw_rate: 0.0_f32,
31310 type_mask: PositionTargetTypemask::DEFAULT,
31311 target_system: 0_u8,
31312 target_component: 0_u8,
31313 coordinate_frame: MavFrame::DEFAULT,
31314 };
31315 #[cfg(feature = "arbitrary")]
31316 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31317 use arbitrary::{Arbitrary, Unstructured};
31318 let mut buf = [0u8; 1024];
31319 rng.fill_bytes(&mut buf);
31320 let mut unstructured = Unstructured::new(&buf);
31321 Self::arbitrary(&mut unstructured).unwrap_or_default()
31322 }
31323}
31324impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
31325 fn default() -> Self {
31326 Self::DEFAULT.clone()
31327 }
31328}
31329impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
31330 type Message = MavMessage;
31331 const ID: u32 = 86u32;
31332 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
31333 const EXTRA_CRC: u8 = 5u8;
31334 const ENCODED_LEN: usize = 53usize;
31335 fn deser(
31336 _version: MavlinkVersion,
31337 __input: &[u8],
31338 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31339 let avail_len = __input.len();
31340 let mut payload_buf = [0; Self::ENCODED_LEN];
31341 let mut buf = if avail_len < Self::ENCODED_LEN {
31342 payload_buf[0..avail_len].copy_from_slice(__input);
31343 Bytes::new(&payload_buf)
31344 } else {
31345 Bytes::new(__input)
31346 };
31347 let mut __struct = Self::default();
31348 __struct.time_boot_ms = buf.get_u32_le();
31349 __struct.lat_int = buf.get_i32_le();
31350 __struct.lon_int = buf.get_i32_le();
31351 __struct.alt = buf.get_f32_le();
31352 __struct.vx = buf.get_f32_le();
31353 __struct.vy = buf.get_f32_le();
31354 __struct.vz = buf.get_f32_le();
31355 __struct.afx = buf.get_f32_le();
31356 __struct.afy = buf.get_f32_le();
31357 __struct.afz = buf.get_f32_le();
31358 __struct.yaw = buf.get_f32_le();
31359 __struct.yaw_rate = buf.get_f32_le();
31360 let tmp = buf.get_u16_le();
31361 __struct.type_mask = PositionTargetTypemask::from_bits(
31362 tmp & PositionTargetTypemask::all().bits(),
31363 )
31364 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31365 flag_type: "PositionTargetTypemask",
31366 value: tmp as u32,
31367 })?;
31368 __struct.target_system = buf.get_u8();
31369 __struct.target_component = buf.get_u8();
31370 let tmp = buf.get_u8();
31371 __struct.coordinate_frame =
31372 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31373 enum_type: "MavFrame",
31374 value: tmp as u32,
31375 })?;
31376 Ok(__struct)
31377 }
31378 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31379 let mut __tmp = BytesMut::new(bytes);
31380 #[allow(clippy::absurd_extreme_comparisons)]
31381 #[allow(unused_comparisons)]
31382 if __tmp.remaining() < Self::ENCODED_LEN {
31383 panic!(
31384 "buffer is too small (need {} bytes, but got {})",
31385 Self::ENCODED_LEN,
31386 __tmp.remaining(),
31387 )
31388 }
31389 __tmp.put_u32_le(self.time_boot_ms);
31390 __tmp.put_i32_le(self.lat_int);
31391 __tmp.put_i32_le(self.lon_int);
31392 __tmp.put_f32_le(self.alt);
31393 __tmp.put_f32_le(self.vx);
31394 __tmp.put_f32_le(self.vy);
31395 __tmp.put_f32_le(self.vz);
31396 __tmp.put_f32_le(self.afx);
31397 __tmp.put_f32_le(self.afy);
31398 __tmp.put_f32_le(self.afz);
31399 __tmp.put_f32_le(self.yaw);
31400 __tmp.put_f32_le(self.yaw_rate);
31401 __tmp.put_u16_le(self.type_mask.bits());
31402 __tmp.put_u8(self.target_system);
31403 __tmp.put_u8(self.target_component);
31404 __tmp.put_u8(self.coordinate_frame as u8);
31405 if matches!(version, MavlinkVersion::V2) {
31406 let len = __tmp.len();
31407 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31408 } else {
31409 __tmp.len()
31410 }
31411 }
31412}
31413#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
31414#[doc = ""]
31415#[doc = "ID: 84"]
31416#[derive(Debug, Clone, PartialEq)]
31417#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31418#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31419#[cfg_attr(feature = "ts", derive(TS))]
31420#[cfg_attr(feature = "ts", ts(export))]
31421pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
31422 #[doc = "Timestamp (time since system boot)."]
31423 pub time_boot_ms: u32,
31424 #[doc = "X Position in NED frame"]
31425 pub x: f32,
31426 #[doc = "Y Position in NED frame"]
31427 pub y: f32,
31428 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
31429 pub z: f32,
31430 #[doc = "X velocity in NED frame"]
31431 pub vx: f32,
31432 #[doc = "Y velocity in NED frame"]
31433 pub vy: f32,
31434 #[doc = "Z velocity in NED frame"]
31435 pub vz: f32,
31436 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
31437 pub afx: f32,
31438 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
31439 pub afy: f32,
31440 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
31441 pub afz: f32,
31442 #[doc = "yaw setpoint"]
31443 pub yaw: f32,
31444 #[doc = "yaw rate setpoint"]
31445 pub yaw_rate: f32,
31446 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
31447 pub type_mask: PositionTargetTypemask,
31448 #[doc = "System ID"]
31449 pub target_system: u8,
31450 #[doc = "Component ID"]
31451 pub target_component: u8,
31452 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
31453 pub coordinate_frame: MavFrame,
31454}
31455impl SET_POSITION_TARGET_LOCAL_NED_DATA {
31456 pub const ENCODED_LEN: usize = 53usize;
31457 pub const DEFAULT: Self = Self {
31458 time_boot_ms: 0_u32,
31459 x: 0.0_f32,
31460 y: 0.0_f32,
31461 z: 0.0_f32,
31462 vx: 0.0_f32,
31463 vy: 0.0_f32,
31464 vz: 0.0_f32,
31465 afx: 0.0_f32,
31466 afy: 0.0_f32,
31467 afz: 0.0_f32,
31468 yaw: 0.0_f32,
31469 yaw_rate: 0.0_f32,
31470 type_mask: PositionTargetTypemask::DEFAULT,
31471 target_system: 0_u8,
31472 target_component: 0_u8,
31473 coordinate_frame: MavFrame::DEFAULT,
31474 };
31475 #[cfg(feature = "arbitrary")]
31476 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31477 use arbitrary::{Arbitrary, Unstructured};
31478 let mut buf = [0u8; 1024];
31479 rng.fill_bytes(&mut buf);
31480 let mut unstructured = Unstructured::new(&buf);
31481 Self::arbitrary(&mut unstructured).unwrap_or_default()
31482 }
31483}
31484impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
31485 fn default() -> Self {
31486 Self::DEFAULT.clone()
31487 }
31488}
31489impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
31490 type Message = MavMessage;
31491 const ID: u32 = 84u32;
31492 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
31493 const EXTRA_CRC: u8 = 143u8;
31494 const ENCODED_LEN: usize = 53usize;
31495 fn deser(
31496 _version: MavlinkVersion,
31497 __input: &[u8],
31498 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31499 let avail_len = __input.len();
31500 let mut payload_buf = [0; Self::ENCODED_LEN];
31501 let mut buf = if avail_len < Self::ENCODED_LEN {
31502 payload_buf[0..avail_len].copy_from_slice(__input);
31503 Bytes::new(&payload_buf)
31504 } else {
31505 Bytes::new(__input)
31506 };
31507 let mut __struct = Self::default();
31508 __struct.time_boot_ms = buf.get_u32_le();
31509 __struct.x = buf.get_f32_le();
31510 __struct.y = buf.get_f32_le();
31511 __struct.z = buf.get_f32_le();
31512 __struct.vx = buf.get_f32_le();
31513 __struct.vy = buf.get_f32_le();
31514 __struct.vz = buf.get_f32_le();
31515 __struct.afx = buf.get_f32_le();
31516 __struct.afy = buf.get_f32_le();
31517 __struct.afz = buf.get_f32_le();
31518 __struct.yaw = buf.get_f32_le();
31519 __struct.yaw_rate = buf.get_f32_le();
31520 let tmp = buf.get_u16_le();
31521 __struct.type_mask = PositionTargetTypemask::from_bits(
31522 tmp & PositionTargetTypemask::all().bits(),
31523 )
31524 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31525 flag_type: "PositionTargetTypemask",
31526 value: tmp as u32,
31527 })?;
31528 __struct.target_system = buf.get_u8();
31529 __struct.target_component = buf.get_u8();
31530 let tmp = buf.get_u8();
31531 __struct.coordinate_frame =
31532 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31533 enum_type: "MavFrame",
31534 value: tmp as u32,
31535 })?;
31536 Ok(__struct)
31537 }
31538 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31539 let mut __tmp = BytesMut::new(bytes);
31540 #[allow(clippy::absurd_extreme_comparisons)]
31541 #[allow(unused_comparisons)]
31542 if __tmp.remaining() < Self::ENCODED_LEN {
31543 panic!(
31544 "buffer is too small (need {} bytes, but got {})",
31545 Self::ENCODED_LEN,
31546 __tmp.remaining(),
31547 )
31548 }
31549 __tmp.put_u32_le(self.time_boot_ms);
31550 __tmp.put_f32_le(self.x);
31551 __tmp.put_f32_le(self.y);
31552 __tmp.put_f32_le(self.z);
31553 __tmp.put_f32_le(self.vx);
31554 __tmp.put_f32_le(self.vy);
31555 __tmp.put_f32_le(self.vz);
31556 __tmp.put_f32_le(self.afx);
31557 __tmp.put_f32_le(self.afy);
31558 __tmp.put_f32_le(self.afz);
31559 __tmp.put_f32_le(self.yaw);
31560 __tmp.put_f32_le(self.yaw_rate);
31561 __tmp.put_u16_le(self.type_mask.bits());
31562 __tmp.put_u8(self.target_system);
31563 __tmp.put_u8(self.target_component);
31564 __tmp.put_u8(self.coordinate_frame as u8);
31565 if matches!(version, MavlinkVersion::V2) {
31566 let len = __tmp.len();
31567 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31568 } else {
31569 __tmp.len()
31570 }
31571 }
31572}
31573#[doc = "Status of simulation environment, if used."]
31574#[doc = ""]
31575#[doc = "ID: 108"]
31576#[derive(Debug, Clone, PartialEq)]
31577#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31578#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31579#[cfg_attr(feature = "ts", derive(TS))]
31580#[cfg_attr(feature = "ts", ts(export))]
31581pub struct SIM_STATE_DATA {
31582 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
31583 pub q1: f32,
31584 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
31585 pub q2: f32,
31586 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
31587 pub q3: f32,
31588 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
31589 pub q4: f32,
31590 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
31591 pub roll: f32,
31592 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
31593 pub pitch: f32,
31594 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
31595 pub yaw: f32,
31596 #[doc = "X acceleration"]
31597 pub xacc: f32,
31598 #[doc = "Y acceleration"]
31599 pub yacc: f32,
31600 #[doc = "Z acceleration"]
31601 pub zacc: f32,
31602 #[doc = "Angular speed around X axis"]
31603 pub xgyro: f32,
31604 #[doc = "Angular speed around Y axis"]
31605 pub ygyro: f32,
31606 #[doc = "Angular speed around Z axis"]
31607 pub zgyro: f32,
31608 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
31609 pub lat: f32,
31610 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
31611 pub lon: f32,
31612 #[doc = "Altitude"]
31613 pub alt: f32,
31614 #[doc = "Horizontal position standard deviation"]
31615 pub std_dev_horz: f32,
31616 #[doc = "Vertical position standard deviation"]
31617 pub std_dev_vert: f32,
31618 #[doc = "True velocity in north direction in earth-fixed NED frame"]
31619 pub vn: f32,
31620 #[doc = "True velocity in east direction in earth-fixed NED frame"]
31621 pub ve: f32,
31622 #[doc = "True velocity in down direction in earth-fixed NED frame"]
31623 pub vd: f32,
31624 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
31625 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31626 pub lat_int: i32,
31627 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
31628 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31629 pub lon_int: i32,
31630}
31631impl SIM_STATE_DATA {
31632 pub const ENCODED_LEN: usize = 92usize;
31633 pub const DEFAULT: Self = Self {
31634 q1: 0.0_f32,
31635 q2: 0.0_f32,
31636 q3: 0.0_f32,
31637 q4: 0.0_f32,
31638 roll: 0.0_f32,
31639 pitch: 0.0_f32,
31640 yaw: 0.0_f32,
31641 xacc: 0.0_f32,
31642 yacc: 0.0_f32,
31643 zacc: 0.0_f32,
31644 xgyro: 0.0_f32,
31645 ygyro: 0.0_f32,
31646 zgyro: 0.0_f32,
31647 lat: 0.0_f32,
31648 lon: 0.0_f32,
31649 alt: 0.0_f32,
31650 std_dev_horz: 0.0_f32,
31651 std_dev_vert: 0.0_f32,
31652 vn: 0.0_f32,
31653 ve: 0.0_f32,
31654 vd: 0.0_f32,
31655 lat_int: 0_i32,
31656 lon_int: 0_i32,
31657 };
31658 #[cfg(feature = "arbitrary")]
31659 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31660 use arbitrary::{Arbitrary, Unstructured};
31661 let mut buf = [0u8; 1024];
31662 rng.fill_bytes(&mut buf);
31663 let mut unstructured = Unstructured::new(&buf);
31664 Self::arbitrary(&mut unstructured).unwrap_or_default()
31665 }
31666}
31667impl Default for SIM_STATE_DATA {
31668 fn default() -> Self {
31669 Self::DEFAULT.clone()
31670 }
31671}
31672impl MessageData for SIM_STATE_DATA {
31673 type Message = MavMessage;
31674 const ID: u32 = 108u32;
31675 const NAME: &'static str = "SIM_STATE";
31676 const EXTRA_CRC: u8 = 32u8;
31677 const ENCODED_LEN: usize = 92usize;
31678 fn deser(
31679 _version: MavlinkVersion,
31680 __input: &[u8],
31681 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31682 let avail_len = __input.len();
31683 let mut payload_buf = [0; Self::ENCODED_LEN];
31684 let mut buf = if avail_len < Self::ENCODED_LEN {
31685 payload_buf[0..avail_len].copy_from_slice(__input);
31686 Bytes::new(&payload_buf)
31687 } else {
31688 Bytes::new(__input)
31689 };
31690 let mut __struct = Self::default();
31691 __struct.q1 = buf.get_f32_le();
31692 __struct.q2 = buf.get_f32_le();
31693 __struct.q3 = buf.get_f32_le();
31694 __struct.q4 = buf.get_f32_le();
31695 __struct.roll = buf.get_f32_le();
31696 __struct.pitch = buf.get_f32_le();
31697 __struct.yaw = buf.get_f32_le();
31698 __struct.xacc = buf.get_f32_le();
31699 __struct.yacc = buf.get_f32_le();
31700 __struct.zacc = buf.get_f32_le();
31701 __struct.xgyro = buf.get_f32_le();
31702 __struct.ygyro = buf.get_f32_le();
31703 __struct.zgyro = buf.get_f32_le();
31704 __struct.lat = buf.get_f32_le();
31705 __struct.lon = buf.get_f32_le();
31706 __struct.alt = buf.get_f32_le();
31707 __struct.std_dev_horz = buf.get_f32_le();
31708 __struct.std_dev_vert = buf.get_f32_le();
31709 __struct.vn = buf.get_f32_le();
31710 __struct.ve = buf.get_f32_le();
31711 __struct.vd = buf.get_f32_le();
31712 __struct.lat_int = buf.get_i32_le();
31713 __struct.lon_int = buf.get_i32_le();
31714 Ok(__struct)
31715 }
31716 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31717 let mut __tmp = BytesMut::new(bytes);
31718 #[allow(clippy::absurd_extreme_comparisons)]
31719 #[allow(unused_comparisons)]
31720 if __tmp.remaining() < Self::ENCODED_LEN {
31721 panic!(
31722 "buffer is too small (need {} bytes, but got {})",
31723 Self::ENCODED_LEN,
31724 __tmp.remaining(),
31725 )
31726 }
31727 __tmp.put_f32_le(self.q1);
31728 __tmp.put_f32_le(self.q2);
31729 __tmp.put_f32_le(self.q3);
31730 __tmp.put_f32_le(self.q4);
31731 __tmp.put_f32_le(self.roll);
31732 __tmp.put_f32_le(self.pitch);
31733 __tmp.put_f32_le(self.yaw);
31734 __tmp.put_f32_le(self.xacc);
31735 __tmp.put_f32_le(self.yacc);
31736 __tmp.put_f32_le(self.zacc);
31737 __tmp.put_f32_le(self.xgyro);
31738 __tmp.put_f32_le(self.ygyro);
31739 __tmp.put_f32_le(self.zgyro);
31740 __tmp.put_f32_le(self.lat);
31741 __tmp.put_f32_le(self.lon);
31742 __tmp.put_f32_le(self.alt);
31743 __tmp.put_f32_le(self.std_dev_horz);
31744 __tmp.put_f32_le(self.std_dev_vert);
31745 __tmp.put_f32_le(self.vn);
31746 __tmp.put_f32_le(self.ve);
31747 __tmp.put_f32_le(self.vd);
31748 if matches!(version, MavlinkVersion::V2) {
31749 __tmp.put_i32_le(self.lat_int);
31750 __tmp.put_i32_le(self.lon_int);
31751 let len = __tmp.len();
31752 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31753 } else {
31754 __tmp.len()
31755 }
31756 }
31757}
31758#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
31759#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
31760#[doc = ""]
31761#[doc = "ID: 370"]
31762#[derive(Debug, Clone, PartialEq)]
31763#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31764#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31765#[cfg_attr(feature = "ts", derive(TS))]
31766#[cfg_attr(feature = "ts", ts(export))]
31767pub struct SMART_BATTERY_INFO_DATA {
31768 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
31769 pub capacity_full_specification: i32,
31770 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
31771 pub capacity_full: i32,
31772 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
31773 pub cycle_count: u16,
31774 #[doc = "Battery weight. 0: field not provided."]
31775 pub weight: u16,
31776 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
31777 pub discharge_minimum_voltage: u16,
31778 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
31779 pub charging_minimum_voltage: u16,
31780 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
31781 pub resting_minimum_voltage: u16,
31782 #[doc = "Battery ID"]
31783 pub id: u8,
31784 #[doc = "Function of the battery"]
31785 pub battery_function: MavBatteryFunction,
31786 #[doc = "Type (chemistry) of the battery"]
31787 pub mavtype: MavBatteryType,
31788 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
31789 #[cfg_attr(
31790 feature = "serde",
31791 serde(
31792 serialize_with = "crate::nulstr::serialize::<_, 16>",
31793 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
31794 )
31795 )]
31796 #[cfg_attr(feature = "ts", ts(type = "string"))]
31797 pub serial_number: [u8; 16],
31798 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
31799 #[cfg_attr(
31800 feature = "serde",
31801 serde(
31802 serialize_with = "crate::nulstr::serialize::<_, 50>",
31803 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
31804 )
31805 )]
31806 #[cfg_attr(feature = "ts", ts(type = "string"))]
31807 pub device_name: [u8; 50],
31808 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
31809 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31810 pub charging_maximum_voltage: u16,
31811 #[doc = "Number of battery cells in series. 0: field not provided."]
31812 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31813 pub cells_in_series: u8,
31814 #[doc = "Maximum pack discharge current. 0: field not provided."]
31815 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31816 pub discharge_maximum_current: u32,
31817 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
31818 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31819 pub discharge_maximum_burst_current: u32,
31820 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
31821 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31822 #[cfg_attr(
31823 feature = "serde",
31824 serde(
31825 serialize_with = "crate::nulstr::serialize::<_, 11>",
31826 deserialize_with = "crate::nulstr::deserialize::<_, 11>"
31827 )
31828 )]
31829 #[cfg_attr(feature = "ts", ts(type = "string"))]
31830 pub manufacture_date: [u8; 11],
31831}
31832impl SMART_BATTERY_INFO_DATA {
31833 pub const ENCODED_LEN: usize = 109usize;
31834 pub const DEFAULT: Self = Self {
31835 capacity_full_specification: 0_i32,
31836 capacity_full: 0_i32,
31837 cycle_count: 0_u16,
31838 weight: 0_u16,
31839 discharge_minimum_voltage: 0_u16,
31840 charging_minimum_voltage: 0_u16,
31841 resting_minimum_voltage: 0_u16,
31842 id: 0_u8,
31843 battery_function: MavBatteryFunction::DEFAULT,
31844 mavtype: MavBatteryType::DEFAULT,
31845 serial_number: [0_u8; 16usize],
31846 device_name: [0_u8; 50usize],
31847 charging_maximum_voltage: 0_u16,
31848 cells_in_series: 0_u8,
31849 discharge_maximum_current: 0_u32,
31850 discharge_maximum_burst_current: 0_u32,
31851 manufacture_date: [0_u8; 11usize],
31852 };
31853 #[cfg(feature = "arbitrary")]
31854 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31855 use arbitrary::{Arbitrary, Unstructured};
31856 let mut buf = [0u8; 1024];
31857 rng.fill_bytes(&mut buf);
31858 let mut unstructured = Unstructured::new(&buf);
31859 Self::arbitrary(&mut unstructured).unwrap_or_default()
31860 }
31861}
31862impl Default for SMART_BATTERY_INFO_DATA {
31863 fn default() -> Self {
31864 Self::DEFAULT.clone()
31865 }
31866}
31867impl MessageData for SMART_BATTERY_INFO_DATA {
31868 type Message = MavMessage;
31869 const ID: u32 = 370u32;
31870 const NAME: &'static str = "SMART_BATTERY_INFO";
31871 const EXTRA_CRC: u8 = 75u8;
31872 const ENCODED_LEN: usize = 109usize;
31873 fn deser(
31874 _version: MavlinkVersion,
31875 __input: &[u8],
31876 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31877 let avail_len = __input.len();
31878 let mut payload_buf = [0; Self::ENCODED_LEN];
31879 let mut buf = if avail_len < Self::ENCODED_LEN {
31880 payload_buf[0..avail_len].copy_from_slice(__input);
31881 Bytes::new(&payload_buf)
31882 } else {
31883 Bytes::new(__input)
31884 };
31885 let mut __struct = Self::default();
31886 __struct.capacity_full_specification = buf.get_i32_le();
31887 __struct.capacity_full = buf.get_i32_le();
31888 __struct.cycle_count = buf.get_u16_le();
31889 __struct.weight = buf.get_u16_le();
31890 __struct.discharge_minimum_voltage = buf.get_u16_le();
31891 __struct.charging_minimum_voltage = buf.get_u16_le();
31892 __struct.resting_minimum_voltage = buf.get_u16_le();
31893 __struct.id = buf.get_u8();
31894 let tmp = buf.get_u8();
31895 __struct.battery_function =
31896 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31897 enum_type: "MavBatteryFunction",
31898 value: tmp as u32,
31899 })?;
31900 let tmp = buf.get_u8();
31901 __struct.mavtype =
31902 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31903 enum_type: "MavBatteryType",
31904 value: tmp as u32,
31905 })?;
31906 for v in &mut __struct.serial_number {
31907 let val = buf.get_u8();
31908 *v = val;
31909 }
31910 for v in &mut __struct.device_name {
31911 let val = buf.get_u8();
31912 *v = val;
31913 }
31914 __struct.charging_maximum_voltage = buf.get_u16_le();
31915 __struct.cells_in_series = buf.get_u8();
31916 __struct.discharge_maximum_current = buf.get_u32_le();
31917 __struct.discharge_maximum_burst_current = buf.get_u32_le();
31918 for v in &mut __struct.manufacture_date {
31919 let val = buf.get_u8();
31920 *v = val;
31921 }
31922 Ok(__struct)
31923 }
31924 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31925 let mut __tmp = BytesMut::new(bytes);
31926 #[allow(clippy::absurd_extreme_comparisons)]
31927 #[allow(unused_comparisons)]
31928 if __tmp.remaining() < Self::ENCODED_LEN {
31929 panic!(
31930 "buffer is too small (need {} bytes, but got {})",
31931 Self::ENCODED_LEN,
31932 __tmp.remaining(),
31933 )
31934 }
31935 __tmp.put_i32_le(self.capacity_full_specification);
31936 __tmp.put_i32_le(self.capacity_full);
31937 __tmp.put_u16_le(self.cycle_count);
31938 __tmp.put_u16_le(self.weight);
31939 __tmp.put_u16_le(self.discharge_minimum_voltage);
31940 __tmp.put_u16_le(self.charging_minimum_voltage);
31941 __tmp.put_u16_le(self.resting_minimum_voltage);
31942 __tmp.put_u8(self.id);
31943 __tmp.put_u8(self.battery_function as u8);
31944 __tmp.put_u8(self.mavtype as u8);
31945 for val in &self.serial_number {
31946 __tmp.put_u8(*val);
31947 }
31948 for val in &self.device_name {
31949 __tmp.put_u8(*val);
31950 }
31951 if matches!(version, MavlinkVersion::V2) {
31952 __tmp.put_u16_le(self.charging_maximum_voltage);
31953 __tmp.put_u8(self.cells_in_series);
31954 __tmp.put_u32_le(self.discharge_maximum_current);
31955 __tmp.put_u32_le(self.discharge_maximum_burst_current);
31956 for val in &self.manufacture_date {
31957 __tmp.put_u8(*val);
31958 }
31959 let len = __tmp.len();
31960 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31961 } else {
31962 __tmp.len()
31963 }
31964 }
31965}
31966#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
31967#[doc = ""]
31968#[doc = "ID: 253"]
31969#[derive(Debug, Clone, PartialEq)]
31970#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31971#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31972#[cfg_attr(feature = "ts", derive(TS))]
31973#[cfg_attr(feature = "ts", ts(export))]
31974pub struct STATUSTEXT_DATA {
31975 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
31976 pub severity: MavSeverity,
31977 #[doc = "Status text message, without null termination character"]
31978 #[cfg_attr(
31979 feature = "serde",
31980 serde(
31981 serialize_with = "crate::nulstr::serialize::<_, 50>",
31982 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
31983 )
31984 )]
31985 #[cfg_attr(feature = "ts", ts(type = "string"))]
31986 pub text: [u8; 50],
31987 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
31988 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31989 pub id: u16,
31990 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
31991 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31992 pub chunk_seq: u8,
31993}
31994impl STATUSTEXT_DATA {
31995 pub const ENCODED_LEN: usize = 54usize;
31996 pub const DEFAULT: Self = Self {
31997 severity: MavSeverity::DEFAULT,
31998 text: [0_u8; 50usize],
31999 id: 0_u16,
32000 chunk_seq: 0_u8,
32001 };
32002 #[cfg(feature = "arbitrary")]
32003 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32004 use arbitrary::{Arbitrary, Unstructured};
32005 let mut buf = [0u8; 1024];
32006 rng.fill_bytes(&mut buf);
32007 let mut unstructured = Unstructured::new(&buf);
32008 Self::arbitrary(&mut unstructured).unwrap_or_default()
32009 }
32010}
32011impl Default for STATUSTEXT_DATA {
32012 fn default() -> Self {
32013 Self::DEFAULT.clone()
32014 }
32015}
32016impl MessageData for STATUSTEXT_DATA {
32017 type Message = MavMessage;
32018 const ID: u32 = 253u32;
32019 const NAME: &'static str = "STATUSTEXT";
32020 const EXTRA_CRC: u8 = 83u8;
32021 const ENCODED_LEN: usize = 54usize;
32022 fn deser(
32023 _version: MavlinkVersion,
32024 __input: &[u8],
32025 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32026 let avail_len = __input.len();
32027 let mut payload_buf = [0; Self::ENCODED_LEN];
32028 let mut buf = if avail_len < Self::ENCODED_LEN {
32029 payload_buf[0..avail_len].copy_from_slice(__input);
32030 Bytes::new(&payload_buf)
32031 } else {
32032 Bytes::new(__input)
32033 };
32034 let mut __struct = Self::default();
32035 let tmp = buf.get_u8();
32036 __struct.severity =
32037 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32038 enum_type: "MavSeverity",
32039 value: tmp as u32,
32040 })?;
32041 for v in &mut __struct.text {
32042 let val = buf.get_u8();
32043 *v = val;
32044 }
32045 __struct.id = buf.get_u16_le();
32046 __struct.chunk_seq = buf.get_u8();
32047 Ok(__struct)
32048 }
32049 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32050 let mut __tmp = BytesMut::new(bytes);
32051 #[allow(clippy::absurd_extreme_comparisons)]
32052 #[allow(unused_comparisons)]
32053 if __tmp.remaining() < Self::ENCODED_LEN {
32054 panic!(
32055 "buffer is too small (need {} bytes, but got {})",
32056 Self::ENCODED_LEN,
32057 __tmp.remaining(),
32058 )
32059 }
32060 __tmp.put_u8(self.severity as u8);
32061 for val in &self.text {
32062 __tmp.put_u8(*val);
32063 }
32064 if matches!(version, MavlinkVersion::V2) {
32065 __tmp.put_u16_le(self.id);
32066 __tmp.put_u8(self.chunk_seq);
32067 let len = __tmp.len();
32068 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32069 } else {
32070 __tmp.len()
32071 }
32072 }
32073}
32074#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
32075#[doc = ""]
32076#[doc = "ID: 261"]
32077#[derive(Debug, Clone, PartialEq)]
32078#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32079#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32080#[cfg_attr(feature = "ts", derive(TS))]
32081#[cfg_attr(feature = "ts", ts(export))]
32082pub struct STORAGE_INFORMATION_DATA {
32083 #[doc = "Timestamp (time since system boot)."]
32084 pub time_boot_ms: u32,
32085 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
32086 pub total_capacity: f32,
32087 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
32088 pub used_capacity: f32,
32089 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
32090 pub available_capacity: f32,
32091 #[doc = "Read speed."]
32092 pub read_speed: f32,
32093 #[doc = "Write speed."]
32094 pub write_speed: f32,
32095 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
32096 pub storage_id: u8,
32097 #[doc = "Number of storage devices"]
32098 pub storage_count: u8,
32099 #[doc = "Status of storage"]
32100 pub status: StorageStatus,
32101 #[doc = "Type of storage"]
32102 #[cfg_attr(feature = "serde", serde(default))]
32103 pub mavtype: StorageType,
32104 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
32105 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32106 #[cfg_attr(
32107 feature = "serde",
32108 serde(
32109 serialize_with = "crate::nulstr::serialize::<_, 32>",
32110 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
32111 )
32112 )]
32113 #[cfg_attr(feature = "ts", ts(type = "string"))]
32114 pub name: [u8; 32],
32115 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
32116 #[cfg_attr(feature = "serde", serde(default))]
32117 pub storage_usage: StorageUsageFlag,
32118}
32119impl STORAGE_INFORMATION_DATA {
32120 pub const ENCODED_LEN: usize = 61usize;
32121 pub const DEFAULT: Self = Self {
32122 time_boot_ms: 0_u32,
32123 total_capacity: 0.0_f32,
32124 used_capacity: 0.0_f32,
32125 available_capacity: 0.0_f32,
32126 read_speed: 0.0_f32,
32127 write_speed: 0.0_f32,
32128 storage_id: 0_u8,
32129 storage_count: 0_u8,
32130 status: StorageStatus::DEFAULT,
32131 mavtype: StorageType::DEFAULT,
32132 name: [0_u8; 32usize],
32133 storage_usage: StorageUsageFlag::DEFAULT,
32134 };
32135 #[cfg(feature = "arbitrary")]
32136 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32137 use arbitrary::{Arbitrary, Unstructured};
32138 let mut buf = [0u8; 1024];
32139 rng.fill_bytes(&mut buf);
32140 let mut unstructured = Unstructured::new(&buf);
32141 Self::arbitrary(&mut unstructured).unwrap_or_default()
32142 }
32143}
32144impl Default for STORAGE_INFORMATION_DATA {
32145 fn default() -> Self {
32146 Self::DEFAULT.clone()
32147 }
32148}
32149impl MessageData for STORAGE_INFORMATION_DATA {
32150 type Message = MavMessage;
32151 const ID: u32 = 261u32;
32152 const NAME: &'static str = "STORAGE_INFORMATION";
32153 const EXTRA_CRC: u8 = 179u8;
32154 const ENCODED_LEN: usize = 61usize;
32155 fn deser(
32156 _version: MavlinkVersion,
32157 __input: &[u8],
32158 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32159 let avail_len = __input.len();
32160 let mut payload_buf = [0; Self::ENCODED_LEN];
32161 let mut buf = if avail_len < Self::ENCODED_LEN {
32162 payload_buf[0..avail_len].copy_from_slice(__input);
32163 Bytes::new(&payload_buf)
32164 } else {
32165 Bytes::new(__input)
32166 };
32167 let mut __struct = Self::default();
32168 __struct.time_boot_ms = buf.get_u32_le();
32169 __struct.total_capacity = buf.get_f32_le();
32170 __struct.used_capacity = buf.get_f32_le();
32171 __struct.available_capacity = buf.get_f32_le();
32172 __struct.read_speed = buf.get_f32_le();
32173 __struct.write_speed = buf.get_f32_le();
32174 __struct.storage_id = buf.get_u8();
32175 __struct.storage_count = buf.get_u8();
32176 let tmp = buf.get_u8();
32177 __struct.status =
32178 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32179 enum_type: "StorageStatus",
32180 value: tmp as u32,
32181 })?;
32182 let tmp = buf.get_u8();
32183 __struct.mavtype =
32184 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32185 enum_type: "StorageType",
32186 value: tmp as u32,
32187 })?;
32188 for v in &mut __struct.name {
32189 let val = buf.get_u8();
32190 *v = val;
32191 }
32192 let tmp = buf.get_u8();
32193 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
32194 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32195 flag_type: "StorageUsageFlag",
32196 value: tmp as u32,
32197 })?;
32198 Ok(__struct)
32199 }
32200 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32201 let mut __tmp = BytesMut::new(bytes);
32202 #[allow(clippy::absurd_extreme_comparisons)]
32203 #[allow(unused_comparisons)]
32204 if __tmp.remaining() < Self::ENCODED_LEN {
32205 panic!(
32206 "buffer is too small (need {} bytes, but got {})",
32207 Self::ENCODED_LEN,
32208 __tmp.remaining(),
32209 )
32210 }
32211 __tmp.put_u32_le(self.time_boot_ms);
32212 __tmp.put_f32_le(self.total_capacity);
32213 __tmp.put_f32_le(self.used_capacity);
32214 __tmp.put_f32_le(self.available_capacity);
32215 __tmp.put_f32_le(self.read_speed);
32216 __tmp.put_f32_le(self.write_speed);
32217 __tmp.put_u8(self.storage_id);
32218 __tmp.put_u8(self.storage_count);
32219 __tmp.put_u8(self.status as u8);
32220 if matches!(version, MavlinkVersion::V2) {
32221 __tmp.put_u8(self.mavtype as u8);
32222 for val in &self.name {
32223 __tmp.put_u8(*val);
32224 }
32225 __tmp.put_u8(self.storage_usage.bits());
32226 let len = __tmp.len();
32227 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32228 } else {
32229 __tmp.len()
32230 }
32231 }
32232}
32233#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
32234#[doc = ""]
32235#[doc = "ID: 401"]
32236#[derive(Debug, Clone, PartialEq)]
32237#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32238#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32239#[cfg_attr(feature = "ts", derive(TS))]
32240#[cfg_attr(feature = "ts", ts(export))]
32241pub struct SUPPORTED_TUNES_DATA {
32242 #[doc = "Bitfield of supported tune formats."]
32243 pub format: TuneFormat,
32244 #[doc = "System ID"]
32245 pub target_system: u8,
32246 #[doc = "Component ID"]
32247 pub target_component: u8,
32248}
32249impl SUPPORTED_TUNES_DATA {
32250 pub const ENCODED_LEN: usize = 6usize;
32251 pub const DEFAULT: Self = Self {
32252 format: TuneFormat::DEFAULT,
32253 target_system: 0_u8,
32254 target_component: 0_u8,
32255 };
32256 #[cfg(feature = "arbitrary")]
32257 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32258 use arbitrary::{Arbitrary, Unstructured};
32259 let mut buf = [0u8; 1024];
32260 rng.fill_bytes(&mut buf);
32261 let mut unstructured = Unstructured::new(&buf);
32262 Self::arbitrary(&mut unstructured).unwrap_or_default()
32263 }
32264}
32265impl Default for SUPPORTED_TUNES_DATA {
32266 fn default() -> Self {
32267 Self::DEFAULT.clone()
32268 }
32269}
32270impl MessageData for SUPPORTED_TUNES_DATA {
32271 type Message = MavMessage;
32272 const ID: u32 = 401u32;
32273 const NAME: &'static str = "SUPPORTED_TUNES";
32274 const EXTRA_CRC: u8 = 183u8;
32275 const ENCODED_LEN: usize = 6usize;
32276 fn deser(
32277 _version: MavlinkVersion,
32278 __input: &[u8],
32279 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32280 let avail_len = __input.len();
32281 let mut payload_buf = [0; Self::ENCODED_LEN];
32282 let mut buf = if avail_len < Self::ENCODED_LEN {
32283 payload_buf[0..avail_len].copy_from_slice(__input);
32284 Bytes::new(&payload_buf)
32285 } else {
32286 Bytes::new(__input)
32287 };
32288 let mut __struct = Self::default();
32289 let tmp = buf.get_u32_le();
32290 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
32291 ::mavlink_core::error::ParserError::InvalidEnum {
32292 enum_type: "TuneFormat",
32293 value: tmp as u32,
32294 },
32295 )?;
32296 __struct.target_system = buf.get_u8();
32297 __struct.target_component = buf.get_u8();
32298 Ok(__struct)
32299 }
32300 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32301 let mut __tmp = BytesMut::new(bytes);
32302 #[allow(clippy::absurd_extreme_comparisons)]
32303 #[allow(unused_comparisons)]
32304 if __tmp.remaining() < Self::ENCODED_LEN {
32305 panic!(
32306 "buffer is too small (need {} bytes, but got {})",
32307 Self::ENCODED_LEN,
32308 __tmp.remaining(),
32309 )
32310 }
32311 __tmp.put_u32_le(self.format as u32);
32312 __tmp.put_u8(self.target_system);
32313 __tmp.put_u8(self.target_component);
32314 if matches!(version, MavlinkVersion::V2) {
32315 let len = __tmp.len();
32316 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32317 } else {
32318 __tmp.len()
32319 }
32320 }
32321}
32322#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
32323#[doc = ""]
32324#[doc = "ID: 2"]
32325#[derive(Debug, Clone, PartialEq)]
32326#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32327#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32328#[cfg_attr(feature = "ts", derive(TS))]
32329#[cfg_attr(feature = "ts", ts(export))]
32330pub struct SYSTEM_TIME_DATA {
32331 #[doc = "Timestamp (UNIX epoch time)."]
32332 pub time_unix_usec: u64,
32333 #[doc = "Timestamp (time since system boot)."]
32334 pub time_boot_ms: u32,
32335}
32336impl SYSTEM_TIME_DATA {
32337 pub const ENCODED_LEN: usize = 12usize;
32338 pub const DEFAULT: Self = Self {
32339 time_unix_usec: 0_u64,
32340 time_boot_ms: 0_u32,
32341 };
32342 #[cfg(feature = "arbitrary")]
32343 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32344 use arbitrary::{Arbitrary, Unstructured};
32345 let mut buf = [0u8; 1024];
32346 rng.fill_bytes(&mut buf);
32347 let mut unstructured = Unstructured::new(&buf);
32348 Self::arbitrary(&mut unstructured).unwrap_or_default()
32349 }
32350}
32351impl Default for SYSTEM_TIME_DATA {
32352 fn default() -> Self {
32353 Self::DEFAULT.clone()
32354 }
32355}
32356impl MessageData for SYSTEM_TIME_DATA {
32357 type Message = MavMessage;
32358 const ID: u32 = 2u32;
32359 const NAME: &'static str = "SYSTEM_TIME";
32360 const EXTRA_CRC: u8 = 137u8;
32361 const ENCODED_LEN: usize = 12usize;
32362 fn deser(
32363 _version: MavlinkVersion,
32364 __input: &[u8],
32365 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32366 let avail_len = __input.len();
32367 let mut payload_buf = [0; Self::ENCODED_LEN];
32368 let mut buf = if avail_len < Self::ENCODED_LEN {
32369 payload_buf[0..avail_len].copy_from_slice(__input);
32370 Bytes::new(&payload_buf)
32371 } else {
32372 Bytes::new(__input)
32373 };
32374 let mut __struct = Self::default();
32375 __struct.time_unix_usec = buf.get_u64_le();
32376 __struct.time_boot_ms = buf.get_u32_le();
32377 Ok(__struct)
32378 }
32379 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32380 let mut __tmp = BytesMut::new(bytes);
32381 #[allow(clippy::absurd_extreme_comparisons)]
32382 #[allow(unused_comparisons)]
32383 if __tmp.remaining() < Self::ENCODED_LEN {
32384 panic!(
32385 "buffer is too small (need {} bytes, but got {})",
32386 Self::ENCODED_LEN,
32387 __tmp.remaining(),
32388 )
32389 }
32390 __tmp.put_u64_le(self.time_unix_usec);
32391 __tmp.put_u32_le(self.time_boot_ms);
32392 if matches!(version, MavlinkVersion::V2) {
32393 let len = __tmp.len();
32394 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32395 } else {
32396 __tmp.len()
32397 }
32398 }
32399}
32400#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
32401#[doc = ""]
32402#[doc = "ID: 1"]
32403#[derive(Debug, Clone, PartialEq)]
32404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32406#[cfg_attr(feature = "ts", derive(TS))]
32407#[cfg_attr(feature = "ts", ts(export))]
32408pub struct SYS_STATUS_DATA {
32409 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
32410 pub onboard_control_sensors_present: MavSysStatusSensor,
32411 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
32412 pub onboard_control_sensors_enabled: MavSysStatusSensor,
32413 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
32414 pub onboard_control_sensors_health: MavSysStatusSensor,
32415 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
32416 pub load: u16,
32417 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
32418 pub voltage_battery: u16,
32419 #[doc = "Battery current, -1: Current not sent by autopilot"]
32420 pub current_battery: i16,
32421 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
32422 pub drop_rate_comm: u16,
32423 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
32424 pub errors_comm: u16,
32425 #[doc = "Autopilot-specific errors"]
32426 pub errors_count1: u16,
32427 #[doc = "Autopilot-specific errors"]
32428 pub errors_count2: u16,
32429 #[doc = "Autopilot-specific errors"]
32430 pub errors_count3: u16,
32431 #[doc = "Autopilot-specific errors"]
32432 pub errors_count4: u16,
32433 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
32434 pub battery_remaining: i8,
32435 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
32436 #[cfg_attr(feature = "serde", serde(default))]
32437 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
32438 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
32439 #[cfg_attr(feature = "serde", serde(default))]
32440 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
32441 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
32442 #[cfg_attr(feature = "serde", serde(default))]
32443 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
32444}
32445impl SYS_STATUS_DATA {
32446 pub const ENCODED_LEN: usize = 43usize;
32447 pub const DEFAULT: Self = Self {
32448 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
32449 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
32450 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
32451 load: 0_u16,
32452 voltage_battery: 0_u16,
32453 current_battery: 0_i16,
32454 drop_rate_comm: 0_u16,
32455 errors_comm: 0_u16,
32456 errors_count1: 0_u16,
32457 errors_count2: 0_u16,
32458 errors_count3: 0_u16,
32459 errors_count4: 0_u16,
32460 battery_remaining: 0_i8,
32461 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
32462 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
32463 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
32464 };
32465 #[cfg(feature = "arbitrary")]
32466 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32467 use arbitrary::{Arbitrary, Unstructured};
32468 let mut buf = [0u8; 1024];
32469 rng.fill_bytes(&mut buf);
32470 let mut unstructured = Unstructured::new(&buf);
32471 Self::arbitrary(&mut unstructured).unwrap_or_default()
32472 }
32473}
32474impl Default for SYS_STATUS_DATA {
32475 fn default() -> Self {
32476 Self::DEFAULT.clone()
32477 }
32478}
32479impl MessageData for SYS_STATUS_DATA {
32480 type Message = MavMessage;
32481 const ID: u32 = 1u32;
32482 const NAME: &'static str = "SYS_STATUS";
32483 const EXTRA_CRC: u8 = 124u8;
32484 const ENCODED_LEN: usize = 43usize;
32485 fn deser(
32486 _version: MavlinkVersion,
32487 __input: &[u8],
32488 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32489 let avail_len = __input.len();
32490 let mut payload_buf = [0; Self::ENCODED_LEN];
32491 let mut buf = if avail_len < Self::ENCODED_LEN {
32492 payload_buf[0..avail_len].copy_from_slice(__input);
32493 Bytes::new(&payload_buf)
32494 } else {
32495 Bytes::new(__input)
32496 };
32497 let mut __struct = Self::default();
32498 let tmp = buf.get_u32_le();
32499 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
32500 tmp & MavSysStatusSensor::all().bits(),
32501 )
32502 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32503 flag_type: "MavSysStatusSensor",
32504 value: tmp as u32,
32505 })?;
32506 let tmp = buf.get_u32_le();
32507 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
32508 tmp & MavSysStatusSensor::all().bits(),
32509 )
32510 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32511 flag_type: "MavSysStatusSensor",
32512 value: tmp as u32,
32513 })?;
32514 let tmp = buf.get_u32_le();
32515 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
32516 tmp & MavSysStatusSensor::all().bits(),
32517 )
32518 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32519 flag_type: "MavSysStatusSensor",
32520 value: tmp as u32,
32521 })?;
32522 __struct.load = buf.get_u16_le();
32523 __struct.voltage_battery = buf.get_u16_le();
32524 __struct.current_battery = buf.get_i16_le();
32525 __struct.drop_rate_comm = buf.get_u16_le();
32526 __struct.errors_comm = buf.get_u16_le();
32527 __struct.errors_count1 = buf.get_u16_le();
32528 __struct.errors_count2 = buf.get_u16_le();
32529 __struct.errors_count3 = buf.get_u16_le();
32530 __struct.errors_count4 = buf.get_u16_le();
32531 __struct.battery_remaining = buf.get_i8();
32532 let tmp = buf.get_u32_le();
32533 __struct.onboard_control_sensors_present_extended =
32534 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
32535 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32536 flag_type: "MavSysStatusSensorExtended",
32537 value: tmp as u32,
32538 })?;
32539 let tmp = buf.get_u32_le();
32540 __struct.onboard_control_sensors_enabled_extended =
32541 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
32542 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32543 flag_type: "MavSysStatusSensorExtended",
32544 value: tmp as u32,
32545 })?;
32546 let tmp = buf.get_u32_le();
32547 __struct.onboard_control_sensors_health_extended =
32548 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
32549 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32550 flag_type: "MavSysStatusSensorExtended",
32551 value: tmp as u32,
32552 })?;
32553 Ok(__struct)
32554 }
32555 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32556 let mut __tmp = BytesMut::new(bytes);
32557 #[allow(clippy::absurd_extreme_comparisons)]
32558 #[allow(unused_comparisons)]
32559 if __tmp.remaining() < Self::ENCODED_LEN {
32560 panic!(
32561 "buffer is too small (need {} bytes, but got {})",
32562 Self::ENCODED_LEN,
32563 __tmp.remaining(),
32564 )
32565 }
32566 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
32567 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
32568 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
32569 __tmp.put_u16_le(self.load);
32570 __tmp.put_u16_le(self.voltage_battery);
32571 __tmp.put_i16_le(self.current_battery);
32572 __tmp.put_u16_le(self.drop_rate_comm);
32573 __tmp.put_u16_le(self.errors_comm);
32574 __tmp.put_u16_le(self.errors_count1);
32575 __tmp.put_u16_le(self.errors_count2);
32576 __tmp.put_u16_le(self.errors_count3);
32577 __tmp.put_u16_le(self.errors_count4);
32578 __tmp.put_i8(self.battery_remaining);
32579 if matches!(version, MavlinkVersion::V2) {
32580 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
32581 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
32582 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
32583 let len = __tmp.len();
32584 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32585 } else {
32586 __tmp.len()
32587 }
32588 }
32589}
32590#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
32591#[doc = ""]
32592#[doc = "ID: 135"]
32593#[derive(Debug, Clone, PartialEq)]
32594#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32595#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32596#[cfg_attr(feature = "ts", derive(TS))]
32597#[cfg_attr(feature = "ts", ts(export))]
32598pub struct TERRAIN_CHECK_DATA {
32599 #[doc = "Latitude"]
32600 pub lat: i32,
32601 #[doc = "Longitude"]
32602 pub lon: i32,
32603}
32604impl TERRAIN_CHECK_DATA {
32605 pub const ENCODED_LEN: usize = 8usize;
32606 pub const DEFAULT: Self = Self {
32607 lat: 0_i32,
32608 lon: 0_i32,
32609 };
32610 #[cfg(feature = "arbitrary")]
32611 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32612 use arbitrary::{Arbitrary, Unstructured};
32613 let mut buf = [0u8; 1024];
32614 rng.fill_bytes(&mut buf);
32615 let mut unstructured = Unstructured::new(&buf);
32616 Self::arbitrary(&mut unstructured).unwrap_or_default()
32617 }
32618}
32619impl Default for TERRAIN_CHECK_DATA {
32620 fn default() -> Self {
32621 Self::DEFAULT.clone()
32622 }
32623}
32624impl MessageData for TERRAIN_CHECK_DATA {
32625 type Message = MavMessage;
32626 const ID: u32 = 135u32;
32627 const NAME: &'static str = "TERRAIN_CHECK";
32628 const EXTRA_CRC: u8 = 203u8;
32629 const ENCODED_LEN: usize = 8usize;
32630 fn deser(
32631 _version: MavlinkVersion,
32632 __input: &[u8],
32633 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32634 let avail_len = __input.len();
32635 let mut payload_buf = [0; Self::ENCODED_LEN];
32636 let mut buf = if avail_len < Self::ENCODED_LEN {
32637 payload_buf[0..avail_len].copy_from_slice(__input);
32638 Bytes::new(&payload_buf)
32639 } else {
32640 Bytes::new(__input)
32641 };
32642 let mut __struct = Self::default();
32643 __struct.lat = buf.get_i32_le();
32644 __struct.lon = buf.get_i32_le();
32645 Ok(__struct)
32646 }
32647 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32648 let mut __tmp = BytesMut::new(bytes);
32649 #[allow(clippy::absurd_extreme_comparisons)]
32650 #[allow(unused_comparisons)]
32651 if __tmp.remaining() < Self::ENCODED_LEN {
32652 panic!(
32653 "buffer is too small (need {} bytes, but got {})",
32654 Self::ENCODED_LEN,
32655 __tmp.remaining(),
32656 )
32657 }
32658 __tmp.put_i32_le(self.lat);
32659 __tmp.put_i32_le(self.lon);
32660 if matches!(version, MavlinkVersion::V2) {
32661 let len = __tmp.len();
32662 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32663 } else {
32664 __tmp.len()
32665 }
32666 }
32667}
32668#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32669#[doc = ""]
32670#[doc = "ID: 134"]
32671#[derive(Debug, Clone, PartialEq)]
32672#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32674#[cfg_attr(feature = "ts", derive(TS))]
32675#[cfg_attr(feature = "ts", ts(export))]
32676pub struct TERRAIN_DATA_DATA {
32677 #[doc = "Latitude of SW corner of first grid"]
32678 pub lat: i32,
32679 #[doc = "Longitude of SW corner of first grid"]
32680 pub lon: i32,
32681 #[doc = "Grid spacing"]
32682 pub grid_spacing: u16,
32683 #[doc = "Terrain data MSL"]
32684 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32685 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32686 pub data: [i16; 16],
32687 #[doc = "bit within the terrain request mask"]
32688 pub gridbit: u8,
32689}
32690impl TERRAIN_DATA_DATA {
32691 pub const ENCODED_LEN: usize = 43usize;
32692 pub const DEFAULT: Self = Self {
32693 lat: 0_i32,
32694 lon: 0_i32,
32695 grid_spacing: 0_u16,
32696 data: [0_i16; 16usize],
32697 gridbit: 0_u8,
32698 };
32699 #[cfg(feature = "arbitrary")]
32700 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32701 use arbitrary::{Arbitrary, Unstructured};
32702 let mut buf = [0u8; 1024];
32703 rng.fill_bytes(&mut buf);
32704 let mut unstructured = Unstructured::new(&buf);
32705 Self::arbitrary(&mut unstructured).unwrap_or_default()
32706 }
32707}
32708impl Default for TERRAIN_DATA_DATA {
32709 fn default() -> Self {
32710 Self::DEFAULT.clone()
32711 }
32712}
32713impl MessageData for TERRAIN_DATA_DATA {
32714 type Message = MavMessage;
32715 const ID: u32 = 134u32;
32716 const NAME: &'static str = "TERRAIN_DATA";
32717 const EXTRA_CRC: u8 = 229u8;
32718 const ENCODED_LEN: usize = 43usize;
32719 fn deser(
32720 _version: MavlinkVersion,
32721 __input: &[u8],
32722 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32723 let avail_len = __input.len();
32724 let mut payload_buf = [0; Self::ENCODED_LEN];
32725 let mut buf = if avail_len < Self::ENCODED_LEN {
32726 payload_buf[0..avail_len].copy_from_slice(__input);
32727 Bytes::new(&payload_buf)
32728 } else {
32729 Bytes::new(__input)
32730 };
32731 let mut __struct = Self::default();
32732 __struct.lat = buf.get_i32_le();
32733 __struct.lon = buf.get_i32_le();
32734 __struct.grid_spacing = buf.get_u16_le();
32735 for v in &mut __struct.data {
32736 let val = buf.get_i16_le();
32737 *v = val;
32738 }
32739 __struct.gridbit = buf.get_u8();
32740 Ok(__struct)
32741 }
32742 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32743 let mut __tmp = BytesMut::new(bytes);
32744 #[allow(clippy::absurd_extreme_comparisons)]
32745 #[allow(unused_comparisons)]
32746 if __tmp.remaining() < Self::ENCODED_LEN {
32747 panic!(
32748 "buffer is too small (need {} bytes, but got {})",
32749 Self::ENCODED_LEN,
32750 __tmp.remaining(),
32751 )
32752 }
32753 __tmp.put_i32_le(self.lat);
32754 __tmp.put_i32_le(self.lon);
32755 __tmp.put_u16_le(self.grid_spacing);
32756 for val in &self.data {
32757 __tmp.put_i16_le(*val);
32758 }
32759 __tmp.put_u8(self.gridbit);
32760 if matches!(version, MavlinkVersion::V2) {
32761 let len = __tmp.len();
32762 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32763 } else {
32764 __tmp.len()
32765 }
32766 }
32767}
32768#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32769#[doc = ""]
32770#[doc = "ID: 136"]
32771#[derive(Debug, Clone, PartialEq)]
32772#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32773#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32774#[cfg_attr(feature = "ts", derive(TS))]
32775#[cfg_attr(feature = "ts", ts(export))]
32776pub struct TERRAIN_REPORT_DATA {
32777 #[doc = "Latitude"]
32778 pub lat: i32,
32779 #[doc = "Longitude"]
32780 pub lon: i32,
32781 #[doc = "Terrain height MSL"]
32782 pub terrain_height: f32,
32783 #[doc = "Current vehicle height above lat/lon terrain height"]
32784 pub current_height: f32,
32785 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
32786 pub spacing: u16,
32787 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
32788 pub pending: u16,
32789 #[doc = "Number of 4x4 terrain blocks in memory"]
32790 pub loaded: u16,
32791}
32792impl TERRAIN_REPORT_DATA {
32793 pub const ENCODED_LEN: usize = 22usize;
32794 pub const DEFAULT: Self = Self {
32795 lat: 0_i32,
32796 lon: 0_i32,
32797 terrain_height: 0.0_f32,
32798 current_height: 0.0_f32,
32799 spacing: 0_u16,
32800 pending: 0_u16,
32801 loaded: 0_u16,
32802 };
32803 #[cfg(feature = "arbitrary")]
32804 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32805 use arbitrary::{Arbitrary, Unstructured};
32806 let mut buf = [0u8; 1024];
32807 rng.fill_bytes(&mut buf);
32808 let mut unstructured = Unstructured::new(&buf);
32809 Self::arbitrary(&mut unstructured).unwrap_or_default()
32810 }
32811}
32812impl Default for TERRAIN_REPORT_DATA {
32813 fn default() -> Self {
32814 Self::DEFAULT.clone()
32815 }
32816}
32817impl MessageData for TERRAIN_REPORT_DATA {
32818 type Message = MavMessage;
32819 const ID: u32 = 136u32;
32820 const NAME: &'static str = "TERRAIN_REPORT";
32821 const EXTRA_CRC: u8 = 1u8;
32822 const ENCODED_LEN: usize = 22usize;
32823 fn deser(
32824 _version: MavlinkVersion,
32825 __input: &[u8],
32826 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32827 let avail_len = __input.len();
32828 let mut payload_buf = [0; Self::ENCODED_LEN];
32829 let mut buf = if avail_len < Self::ENCODED_LEN {
32830 payload_buf[0..avail_len].copy_from_slice(__input);
32831 Bytes::new(&payload_buf)
32832 } else {
32833 Bytes::new(__input)
32834 };
32835 let mut __struct = Self::default();
32836 __struct.lat = buf.get_i32_le();
32837 __struct.lon = buf.get_i32_le();
32838 __struct.terrain_height = buf.get_f32_le();
32839 __struct.current_height = buf.get_f32_le();
32840 __struct.spacing = buf.get_u16_le();
32841 __struct.pending = buf.get_u16_le();
32842 __struct.loaded = buf.get_u16_le();
32843 Ok(__struct)
32844 }
32845 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32846 let mut __tmp = BytesMut::new(bytes);
32847 #[allow(clippy::absurd_extreme_comparisons)]
32848 #[allow(unused_comparisons)]
32849 if __tmp.remaining() < Self::ENCODED_LEN {
32850 panic!(
32851 "buffer is too small (need {} bytes, but got {})",
32852 Self::ENCODED_LEN,
32853 __tmp.remaining(),
32854 )
32855 }
32856 __tmp.put_i32_le(self.lat);
32857 __tmp.put_i32_le(self.lon);
32858 __tmp.put_f32_le(self.terrain_height);
32859 __tmp.put_f32_le(self.current_height);
32860 __tmp.put_u16_le(self.spacing);
32861 __tmp.put_u16_le(self.pending);
32862 __tmp.put_u16_le(self.loaded);
32863 if matches!(version, MavlinkVersion::V2) {
32864 let len = __tmp.len();
32865 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32866 } else {
32867 __tmp.len()
32868 }
32869 }
32870}
32871#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32872#[doc = ""]
32873#[doc = "ID: 133"]
32874#[derive(Debug, Clone, PartialEq)]
32875#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32876#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32877#[cfg_attr(feature = "ts", derive(TS))]
32878#[cfg_attr(feature = "ts", ts(export))]
32879pub struct TERRAIN_REQUEST_DATA {
32880 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
32881 pub mask: u64,
32882 #[doc = "Latitude of SW corner of first grid"]
32883 pub lat: i32,
32884 #[doc = "Longitude of SW corner of first grid"]
32885 pub lon: i32,
32886 #[doc = "Grid spacing"]
32887 pub grid_spacing: u16,
32888}
32889impl TERRAIN_REQUEST_DATA {
32890 pub const ENCODED_LEN: usize = 18usize;
32891 pub const DEFAULT: Self = Self {
32892 mask: 0_u64,
32893 lat: 0_i32,
32894 lon: 0_i32,
32895 grid_spacing: 0_u16,
32896 };
32897 #[cfg(feature = "arbitrary")]
32898 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32899 use arbitrary::{Arbitrary, Unstructured};
32900 let mut buf = [0u8; 1024];
32901 rng.fill_bytes(&mut buf);
32902 let mut unstructured = Unstructured::new(&buf);
32903 Self::arbitrary(&mut unstructured).unwrap_or_default()
32904 }
32905}
32906impl Default for TERRAIN_REQUEST_DATA {
32907 fn default() -> Self {
32908 Self::DEFAULT.clone()
32909 }
32910}
32911impl MessageData for TERRAIN_REQUEST_DATA {
32912 type Message = MavMessage;
32913 const ID: u32 = 133u32;
32914 const NAME: &'static str = "TERRAIN_REQUEST";
32915 const EXTRA_CRC: u8 = 6u8;
32916 const ENCODED_LEN: usize = 18usize;
32917 fn deser(
32918 _version: MavlinkVersion,
32919 __input: &[u8],
32920 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32921 let avail_len = __input.len();
32922 let mut payload_buf = [0; Self::ENCODED_LEN];
32923 let mut buf = if avail_len < Self::ENCODED_LEN {
32924 payload_buf[0..avail_len].copy_from_slice(__input);
32925 Bytes::new(&payload_buf)
32926 } else {
32927 Bytes::new(__input)
32928 };
32929 let mut __struct = Self::default();
32930 __struct.mask = buf.get_u64_le();
32931 __struct.lat = buf.get_i32_le();
32932 __struct.lon = buf.get_i32_le();
32933 __struct.grid_spacing = buf.get_u16_le();
32934 Ok(__struct)
32935 }
32936 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32937 let mut __tmp = BytesMut::new(bytes);
32938 #[allow(clippy::absurd_extreme_comparisons)]
32939 #[allow(unused_comparisons)]
32940 if __tmp.remaining() < Self::ENCODED_LEN {
32941 panic!(
32942 "buffer is too small (need {} bytes, but got {})",
32943 Self::ENCODED_LEN,
32944 __tmp.remaining(),
32945 )
32946 }
32947 __tmp.put_u64_le(self.mask);
32948 __tmp.put_i32_le(self.lat);
32949 __tmp.put_i32_le(self.lon);
32950 __tmp.put_u16_le(self.grid_spacing);
32951 if matches!(version, MavlinkVersion::V2) {
32952 let len = __tmp.len();
32953 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32954 } else {
32955 __tmp.len()
32956 }
32957 }
32958}
32959#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
32960#[doc = ""]
32961#[doc = "ID: 111"]
32962#[derive(Debug, Clone, PartialEq)]
32963#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32964#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32965#[cfg_attr(feature = "ts", derive(TS))]
32966#[cfg_attr(feature = "ts", ts(export))]
32967pub struct TIMESYNC_DATA {
32968 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
32969 pub tc1: i64,
32970 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
32971 pub ts1: i64,
32972 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
32973 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32974 pub target_system: u8,
32975 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
32976 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32977 pub target_component: u8,
32978}
32979impl TIMESYNC_DATA {
32980 pub const ENCODED_LEN: usize = 18usize;
32981 pub const DEFAULT: Self = Self {
32982 tc1: 0_i64,
32983 ts1: 0_i64,
32984 target_system: 0_u8,
32985 target_component: 0_u8,
32986 };
32987 #[cfg(feature = "arbitrary")]
32988 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32989 use arbitrary::{Arbitrary, Unstructured};
32990 let mut buf = [0u8; 1024];
32991 rng.fill_bytes(&mut buf);
32992 let mut unstructured = Unstructured::new(&buf);
32993 Self::arbitrary(&mut unstructured).unwrap_or_default()
32994 }
32995}
32996impl Default for TIMESYNC_DATA {
32997 fn default() -> Self {
32998 Self::DEFAULT.clone()
32999 }
33000}
33001impl MessageData for TIMESYNC_DATA {
33002 type Message = MavMessage;
33003 const ID: u32 = 111u32;
33004 const NAME: &'static str = "TIMESYNC";
33005 const EXTRA_CRC: u8 = 34u8;
33006 const ENCODED_LEN: usize = 18usize;
33007 fn deser(
33008 _version: MavlinkVersion,
33009 __input: &[u8],
33010 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33011 let avail_len = __input.len();
33012 let mut payload_buf = [0; Self::ENCODED_LEN];
33013 let mut buf = if avail_len < Self::ENCODED_LEN {
33014 payload_buf[0..avail_len].copy_from_slice(__input);
33015 Bytes::new(&payload_buf)
33016 } else {
33017 Bytes::new(__input)
33018 };
33019 let mut __struct = Self::default();
33020 __struct.tc1 = buf.get_i64_le();
33021 __struct.ts1 = buf.get_i64_le();
33022 __struct.target_system = buf.get_u8();
33023 __struct.target_component = buf.get_u8();
33024 Ok(__struct)
33025 }
33026 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33027 let mut __tmp = BytesMut::new(bytes);
33028 #[allow(clippy::absurd_extreme_comparisons)]
33029 #[allow(unused_comparisons)]
33030 if __tmp.remaining() < Self::ENCODED_LEN {
33031 panic!(
33032 "buffer is too small (need {} bytes, but got {})",
33033 Self::ENCODED_LEN,
33034 __tmp.remaining(),
33035 )
33036 }
33037 __tmp.put_i64_le(self.tc1);
33038 __tmp.put_i64_le(self.ts1);
33039 if matches!(version, MavlinkVersion::V2) {
33040 __tmp.put_u8(self.target_system);
33041 __tmp.put_u8(self.target_component);
33042 let len = __tmp.len();
33043 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33044 } else {
33045 __tmp.len()
33046 }
33047 }
33048}
33049#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
33050#[doc = ""]
33051#[doc = "ID: 380"]
33052#[derive(Debug, Clone, PartialEq)]
33053#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33054#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33055#[cfg_attr(feature = "ts", derive(TS))]
33056#[cfg_attr(feature = "ts", ts(export))]
33057pub struct TIME_ESTIMATE_TO_TARGET_DATA {
33058 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
33059 pub safe_return: i32,
33060 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
33061 pub land: i32,
33062 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
33063 pub mission_next_item: i32,
33064 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
33065 pub mission_end: i32,
33066 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
33067 pub commanded_action: i32,
33068}
33069impl TIME_ESTIMATE_TO_TARGET_DATA {
33070 pub const ENCODED_LEN: usize = 20usize;
33071 pub const DEFAULT: Self = Self {
33072 safe_return: 0_i32,
33073 land: 0_i32,
33074 mission_next_item: 0_i32,
33075 mission_end: 0_i32,
33076 commanded_action: 0_i32,
33077 };
33078 #[cfg(feature = "arbitrary")]
33079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33080 use arbitrary::{Arbitrary, Unstructured};
33081 let mut buf = [0u8; 1024];
33082 rng.fill_bytes(&mut buf);
33083 let mut unstructured = Unstructured::new(&buf);
33084 Self::arbitrary(&mut unstructured).unwrap_or_default()
33085 }
33086}
33087impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
33088 fn default() -> Self {
33089 Self::DEFAULT.clone()
33090 }
33091}
33092impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
33093 type Message = MavMessage;
33094 const ID: u32 = 380u32;
33095 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
33096 const EXTRA_CRC: u8 = 232u8;
33097 const ENCODED_LEN: usize = 20usize;
33098 fn deser(
33099 _version: MavlinkVersion,
33100 __input: &[u8],
33101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33102 let avail_len = __input.len();
33103 let mut payload_buf = [0; Self::ENCODED_LEN];
33104 let mut buf = if avail_len < Self::ENCODED_LEN {
33105 payload_buf[0..avail_len].copy_from_slice(__input);
33106 Bytes::new(&payload_buf)
33107 } else {
33108 Bytes::new(__input)
33109 };
33110 let mut __struct = Self::default();
33111 __struct.safe_return = buf.get_i32_le();
33112 __struct.land = buf.get_i32_le();
33113 __struct.mission_next_item = buf.get_i32_le();
33114 __struct.mission_end = buf.get_i32_le();
33115 __struct.commanded_action = buf.get_i32_le();
33116 Ok(__struct)
33117 }
33118 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33119 let mut __tmp = BytesMut::new(bytes);
33120 #[allow(clippy::absurd_extreme_comparisons)]
33121 #[allow(unused_comparisons)]
33122 if __tmp.remaining() < Self::ENCODED_LEN {
33123 panic!(
33124 "buffer is too small (need {} bytes, but got {})",
33125 Self::ENCODED_LEN,
33126 __tmp.remaining(),
33127 )
33128 }
33129 __tmp.put_i32_le(self.safe_return);
33130 __tmp.put_i32_le(self.land);
33131 __tmp.put_i32_le(self.mission_next_item);
33132 __tmp.put_i32_le(self.mission_end);
33133 __tmp.put_i32_le(self.commanded_action);
33134 if matches!(version, MavlinkVersion::V2) {
33135 let len = __tmp.len();
33136 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33137 } else {
33138 __tmp.len()
33139 }
33140 }
33141}
33142#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
33143#[doc = ""]
33144#[doc = "ID: 333"]
33145#[derive(Debug, Clone, PartialEq)]
33146#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33147#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33148#[cfg_attr(feature = "ts", derive(TS))]
33149#[cfg_attr(feature = "ts", ts(export))]
33150pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
33151 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
33152 pub time_usec: u64,
33153 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
33154 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33155 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33156 pub pos_x: [f32; 5],
33157 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
33158 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33159 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33160 pub pos_y: [f32; 5],
33161 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
33162 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33163 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33164 pub pos_z: [f32; 5],
33165 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
33166 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33167 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33168 pub delta: [f32; 5],
33169 #[doc = "Yaw. Set to NaN for unchanged"]
33170 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33171 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33172 pub pos_yaw: [f32; 5],
33173 #[doc = "Number of valid control points (up-to 5 points are possible)"]
33174 pub valid_points: u8,
33175}
33176impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
33177 pub const ENCODED_LEN: usize = 109usize;
33178 pub const DEFAULT: Self = Self {
33179 time_usec: 0_u64,
33180 pos_x: [0.0_f32; 5usize],
33181 pos_y: [0.0_f32; 5usize],
33182 pos_z: [0.0_f32; 5usize],
33183 delta: [0.0_f32; 5usize],
33184 pos_yaw: [0.0_f32; 5usize],
33185 valid_points: 0_u8,
33186 };
33187 #[cfg(feature = "arbitrary")]
33188 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33189 use arbitrary::{Arbitrary, Unstructured};
33190 let mut buf = [0u8; 1024];
33191 rng.fill_bytes(&mut buf);
33192 let mut unstructured = Unstructured::new(&buf);
33193 Self::arbitrary(&mut unstructured).unwrap_or_default()
33194 }
33195}
33196impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
33197 fn default() -> Self {
33198 Self::DEFAULT.clone()
33199 }
33200}
33201impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
33202 type Message = MavMessage;
33203 const ID: u32 = 333u32;
33204 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
33205 const EXTRA_CRC: u8 = 231u8;
33206 const ENCODED_LEN: usize = 109usize;
33207 fn deser(
33208 _version: MavlinkVersion,
33209 __input: &[u8],
33210 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33211 let avail_len = __input.len();
33212 let mut payload_buf = [0; Self::ENCODED_LEN];
33213 let mut buf = if avail_len < Self::ENCODED_LEN {
33214 payload_buf[0..avail_len].copy_from_slice(__input);
33215 Bytes::new(&payload_buf)
33216 } else {
33217 Bytes::new(__input)
33218 };
33219 let mut __struct = Self::default();
33220 __struct.time_usec = buf.get_u64_le();
33221 for v in &mut __struct.pos_x {
33222 let val = buf.get_f32_le();
33223 *v = val;
33224 }
33225 for v in &mut __struct.pos_y {
33226 let val = buf.get_f32_le();
33227 *v = val;
33228 }
33229 for v in &mut __struct.pos_z {
33230 let val = buf.get_f32_le();
33231 *v = val;
33232 }
33233 for v in &mut __struct.delta {
33234 let val = buf.get_f32_le();
33235 *v = val;
33236 }
33237 for v in &mut __struct.pos_yaw {
33238 let val = buf.get_f32_le();
33239 *v = val;
33240 }
33241 __struct.valid_points = buf.get_u8();
33242 Ok(__struct)
33243 }
33244 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33245 let mut __tmp = BytesMut::new(bytes);
33246 #[allow(clippy::absurd_extreme_comparisons)]
33247 #[allow(unused_comparisons)]
33248 if __tmp.remaining() < Self::ENCODED_LEN {
33249 panic!(
33250 "buffer is too small (need {} bytes, but got {})",
33251 Self::ENCODED_LEN,
33252 __tmp.remaining(),
33253 )
33254 }
33255 __tmp.put_u64_le(self.time_usec);
33256 for val in &self.pos_x {
33257 __tmp.put_f32_le(*val);
33258 }
33259 for val in &self.pos_y {
33260 __tmp.put_f32_le(*val);
33261 }
33262 for val in &self.pos_z {
33263 __tmp.put_f32_le(*val);
33264 }
33265 for val in &self.delta {
33266 __tmp.put_f32_le(*val);
33267 }
33268 for val in &self.pos_yaw {
33269 __tmp.put_f32_le(*val);
33270 }
33271 __tmp.put_u8(self.valid_points);
33272 if matches!(version, MavlinkVersion::V2) {
33273 let len = __tmp.len();
33274 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33275 } else {
33276 __tmp.len()
33277 }
33278 }
33279}
33280#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
33281#[doc = ""]
33282#[doc = "ID: 332"]
33283#[derive(Debug, Clone, PartialEq)]
33284#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33285#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33286#[cfg_attr(feature = "ts", derive(TS))]
33287#[cfg_attr(feature = "ts", ts(export))]
33288pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
33289 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
33290 pub time_usec: u64,
33291 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
33292 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33293 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33294 pub pos_x: [f32; 5],
33295 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
33296 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33297 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33298 pub pos_y: [f32; 5],
33299 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
33300 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33301 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33302 pub pos_z: [f32; 5],
33303 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
33304 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33305 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33306 pub vel_x: [f32; 5],
33307 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
33308 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33309 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33310 pub vel_y: [f32; 5],
33311 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
33312 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33313 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33314 pub vel_z: [f32; 5],
33315 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
33316 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33317 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33318 pub acc_x: [f32; 5],
33319 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
33320 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33321 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33322 pub acc_y: [f32; 5],
33323 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
33324 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33325 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33326 pub acc_z: [f32; 5],
33327 #[doc = "Yaw angle, set to NaN if not being used"]
33328 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33329 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33330 pub pos_yaw: [f32; 5],
33331 #[doc = "Yaw rate, set to NaN if not being used"]
33332 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33333 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33334 pub vel_yaw: [f32; 5],
33335 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
33336 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33337 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33338 pub command: [u16; 5],
33339 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
33340 pub valid_points: u8,
33341}
33342impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
33343 pub const ENCODED_LEN: usize = 239usize;
33344 pub const DEFAULT: Self = Self {
33345 time_usec: 0_u64,
33346 pos_x: [0.0_f32; 5usize],
33347 pos_y: [0.0_f32; 5usize],
33348 pos_z: [0.0_f32; 5usize],
33349 vel_x: [0.0_f32; 5usize],
33350 vel_y: [0.0_f32; 5usize],
33351 vel_z: [0.0_f32; 5usize],
33352 acc_x: [0.0_f32; 5usize],
33353 acc_y: [0.0_f32; 5usize],
33354 acc_z: [0.0_f32; 5usize],
33355 pos_yaw: [0.0_f32; 5usize],
33356 vel_yaw: [0.0_f32; 5usize],
33357 command: [0_u16; 5usize],
33358 valid_points: 0_u8,
33359 };
33360 #[cfg(feature = "arbitrary")]
33361 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33362 use arbitrary::{Arbitrary, Unstructured};
33363 let mut buf = [0u8; 1024];
33364 rng.fill_bytes(&mut buf);
33365 let mut unstructured = Unstructured::new(&buf);
33366 Self::arbitrary(&mut unstructured).unwrap_or_default()
33367 }
33368}
33369impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
33370 fn default() -> Self {
33371 Self::DEFAULT.clone()
33372 }
33373}
33374impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
33375 type Message = MavMessage;
33376 const ID: u32 = 332u32;
33377 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
33378 const EXTRA_CRC: u8 = 236u8;
33379 const ENCODED_LEN: usize = 239usize;
33380 fn deser(
33381 _version: MavlinkVersion,
33382 __input: &[u8],
33383 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33384 let avail_len = __input.len();
33385 let mut payload_buf = [0; Self::ENCODED_LEN];
33386 let mut buf = if avail_len < Self::ENCODED_LEN {
33387 payload_buf[0..avail_len].copy_from_slice(__input);
33388 Bytes::new(&payload_buf)
33389 } else {
33390 Bytes::new(__input)
33391 };
33392 let mut __struct = Self::default();
33393 __struct.time_usec = buf.get_u64_le();
33394 for v in &mut __struct.pos_x {
33395 let val = buf.get_f32_le();
33396 *v = val;
33397 }
33398 for v in &mut __struct.pos_y {
33399 let val = buf.get_f32_le();
33400 *v = val;
33401 }
33402 for v in &mut __struct.pos_z {
33403 let val = buf.get_f32_le();
33404 *v = val;
33405 }
33406 for v in &mut __struct.vel_x {
33407 let val = buf.get_f32_le();
33408 *v = val;
33409 }
33410 for v in &mut __struct.vel_y {
33411 let val = buf.get_f32_le();
33412 *v = val;
33413 }
33414 for v in &mut __struct.vel_z {
33415 let val = buf.get_f32_le();
33416 *v = val;
33417 }
33418 for v in &mut __struct.acc_x {
33419 let val = buf.get_f32_le();
33420 *v = val;
33421 }
33422 for v in &mut __struct.acc_y {
33423 let val = buf.get_f32_le();
33424 *v = val;
33425 }
33426 for v in &mut __struct.acc_z {
33427 let val = buf.get_f32_le();
33428 *v = val;
33429 }
33430 for v in &mut __struct.pos_yaw {
33431 let val = buf.get_f32_le();
33432 *v = val;
33433 }
33434 for v in &mut __struct.vel_yaw {
33435 let val = buf.get_f32_le();
33436 *v = val;
33437 }
33438 for v in &mut __struct.command {
33439 let val = buf.get_u16_le();
33440 *v = val;
33441 }
33442 __struct.valid_points = buf.get_u8();
33443 Ok(__struct)
33444 }
33445 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33446 let mut __tmp = BytesMut::new(bytes);
33447 #[allow(clippy::absurd_extreme_comparisons)]
33448 #[allow(unused_comparisons)]
33449 if __tmp.remaining() < Self::ENCODED_LEN {
33450 panic!(
33451 "buffer is too small (need {} bytes, but got {})",
33452 Self::ENCODED_LEN,
33453 __tmp.remaining(),
33454 )
33455 }
33456 __tmp.put_u64_le(self.time_usec);
33457 for val in &self.pos_x {
33458 __tmp.put_f32_le(*val);
33459 }
33460 for val in &self.pos_y {
33461 __tmp.put_f32_le(*val);
33462 }
33463 for val in &self.pos_z {
33464 __tmp.put_f32_le(*val);
33465 }
33466 for val in &self.vel_x {
33467 __tmp.put_f32_le(*val);
33468 }
33469 for val in &self.vel_y {
33470 __tmp.put_f32_le(*val);
33471 }
33472 for val in &self.vel_z {
33473 __tmp.put_f32_le(*val);
33474 }
33475 for val in &self.acc_x {
33476 __tmp.put_f32_le(*val);
33477 }
33478 for val in &self.acc_y {
33479 __tmp.put_f32_le(*val);
33480 }
33481 for val in &self.acc_z {
33482 __tmp.put_f32_le(*val);
33483 }
33484 for val in &self.pos_yaw {
33485 __tmp.put_f32_le(*val);
33486 }
33487 for val in &self.vel_yaw {
33488 __tmp.put_f32_le(*val);
33489 }
33490 for val in &self.command {
33491 __tmp.put_u16_le(*val);
33492 }
33493 __tmp.put_u8(self.valid_points);
33494 if matches!(version, MavlinkVersion::V2) {
33495 let len = __tmp.len();
33496 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33497 } else {
33498 __tmp.len()
33499 }
33500 }
33501}
33502#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
33503#[doc = ""]
33504#[doc = "ID: 385"]
33505#[derive(Debug, Clone, PartialEq)]
33506#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33507#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33508#[cfg_attr(feature = "ts", derive(TS))]
33509#[cfg_attr(feature = "ts", ts(export))]
33510pub struct TUNNEL_DATA {
33511 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
33512 pub payload_type: MavTunnelPayloadType,
33513 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
33514 pub target_system: u8,
33515 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
33516 pub target_component: u8,
33517 #[doc = "Length of the data transported in payload"]
33518 pub payload_length: u8,
33519 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
33520 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33521 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33522 pub payload: [u8; 128],
33523}
33524impl TUNNEL_DATA {
33525 pub const ENCODED_LEN: usize = 133usize;
33526 pub const DEFAULT: Self = Self {
33527 payload_type: MavTunnelPayloadType::DEFAULT,
33528 target_system: 0_u8,
33529 target_component: 0_u8,
33530 payload_length: 0_u8,
33531 payload: [0_u8; 128usize],
33532 };
33533 #[cfg(feature = "arbitrary")]
33534 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33535 use arbitrary::{Arbitrary, Unstructured};
33536 let mut buf = [0u8; 1024];
33537 rng.fill_bytes(&mut buf);
33538 let mut unstructured = Unstructured::new(&buf);
33539 Self::arbitrary(&mut unstructured).unwrap_or_default()
33540 }
33541}
33542impl Default for TUNNEL_DATA {
33543 fn default() -> Self {
33544 Self::DEFAULT.clone()
33545 }
33546}
33547impl MessageData for TUNNEL_DATA {
33548 type Message = MavMessage;
33549 const ID: u32 = 385u32;
33550 const NAME: &'static str = "TUNNEL";
33551 const EXTRA_CRC: u8 = 147u8;
33552 const ENCODED_LEN: usize = 133usize;
33553 fn deser(
33554 _version: MavlinkVersion,
33555 __input: &[u8],
33556 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33557 let avail_len = __input.len();
33558 let mut payload_buf = [0; Self::ENCODED_LEN];
33559 let mut buf = if avail_len < Self::ENCODED_LEN {
33560 payload_buf[0..avail_len].copy_from_slice(__input);
33561 Bytes::new(&payload_buf)
33562 } else {
33563 Bytes::new(__input)
33564 };
33565 let mut __struct = Self::default();
33566 let tmp = buf.get_u16_le();
33567 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
33568 ::mavlink_core::error::ParserError::InvalidEnum {
33569 enum_type: "MavTunnelPayloadType",
33570 value: tmp as u32,
33571 },
33572 )?;
33573 __struct.target_system = buf.get_u8();
33574 __struct.target_component = buf.get_u8();
33575 __struct.payload_length = buf.get_u8();
33576 for v in &mut __struct.payload {
33577 let val = buf.get_u8();
33578 *v = val;
33579 }
33580 Ok(__struct)
33581 }
33582 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33583 let mut __tmp = BytesMut::new(bytes);
33584 #[allow(clippy::absurd_extreme_comparisons)]
33585 #[allow(unused_comparisons)]
33586 if __tmp.remaining() < Self::ENCODED_LEN {
33587 panic!(
33588 "buffer is too small (need {} bytes, but got {})",
33589 Self::ENCODED_LEN,
33590 __tmp.remaining(),
33591 )
33592 }
33593 __tmp.put_u16_le(self.payload_type as u16);
33594 __tmp.put_u8(self.target_system);
33595 __tmp.put_u8(self.target_component);
33596 __tmp.put_u8(self.payload_length);
33597 for val in &self.payload {
33598 __tmp.put_u8(*val);
33599 }
33600 if matches!(version, MavlinkVersion::V2) {
33601 let len = __tmp.len();
33602 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33603 } else {
33604 __tmp.len()
33605 }
33606 }
33607}
33608#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
33609#[doc = ""]
33610#[doc = "ID: 311"]
33611#[derive(Debug, Clone, PartialEq)]
33612#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33613#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33614#[cfg_attr(feature = "ts", derive(TS))]
33615#[cfg_attr(feature = "ts", ts(export))]
33616pub struct UAVCAN_NODE_INFO_DATA {
33617 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
33618 pub time_usec: u64,
33619 #[doc = "Time since the start-up of the node."]
33620 pub uptime_sec: u32,
33621 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
33622 pub sw_vcs_commit: u32,
33623 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
33624 #[cfg_attr(
33625 feature = "serde",
33626 serde(
33627 serialize_with = "crate::nulstr::serialize::<_, 80>",
33628 deserialize_with = "crate::nulstr::deserialize::<_, 80>"
33629 )
33630 )]
33631 #[cfg_attr(feature = "ts", ts(type = "string"))]
33632 pub name: [u8; 80],
33633 #[doc = "Hardware major version number."]
33634 pub hw_version_major: u8,
33635 #[doc = "Hardware minor version number."]
33636 pub hw_version_minor: u8,
33637 #[doc = "Hardware unique 128-bit ID."]
33638 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33639 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33640 pub hw_unique_id: [u8; 16],
33641 #[doc = "Software major version number."]
33642 pub sw_version_major: u8,
33643 #[doc = "Software minor version number."]
33644 pub sw_version_minor: u8,
33645}
33646impl UAVCAN_NODE_INFO_DATA {
33647 pub const ENCODED_LEN: usize = 116usize;
33648 pub const DEFAULT: Self = Self {
33649 time_usec: 0_u64,
33650 uptime_sec: 0_u32,
33651 sw_vcs_commit: 0_u32,
33652 name: [0_u8; 80usize],
33653 hw_version_major: 0_u8,
33654 hw_version_minor: 0_u8,
33655 hw_unique_id: [0_u8; 16usize],
33656 sw_version_major: 0_u8,
33657 sw_version_minor: 0_u8,
33658 };
33659 #[cfg(feature = "arbitrary")]
33660 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33661 use arbitrary::{Arbitrary, Unstructured};
33662 let mut buf = [0u8; 1024];
33663 rng.fill_bytes(&mut buf);
33664 let mut unstructured = Unstructured::new(&buf);
33665 Self::arbitrary(&mut unstructured).unwrap_or_default()
33666 }
33667}
33668impl Default for UAVCAN_NODE_INFO_DATA {
33669 fn default() -> Self {
33670 Self::DEFAULT.clone()
33671 }
33672}
33673impl MessageData for UAVCAN_NODE_INFO_DATA {
33674 type Message = MavMessage;
33675 const ID: u32 = 311u32;
33676 const NAME: &'static str = "UAVCAN_NODE_INFO";
33677 const EXTRA_CRC: u8 = 95u8;
33678 const ENCODED_LEN: usize = 116usize;
33679 fn deser(
33680 _version: MavlinkVersion,
33681 __input: &[u8],
33682 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33683 let avail_len = __input.len();
33684 let mut payload_buf = [0; Self::ENCODED_LEN];
33685 let mut buf = if avail_len < Self::ENCODED_LEN {
33686 payload_buf[0..avail_len].copy_from_slice(__input);
33687 Bytes::new(&payload_buf)
33688 } else {
33689 Bytes::new(__input)
33690 };
33691 let mut __struct = Self::default();
33692 __struct.time_usec = buf.get_u64_le();
33693 __struct.uptime_sec = buf.get_u32_le();
33694 __struct.sw_vcs_commit = buf.get_u32_le();
33695 for v in &mut __struct.name {
33696 let val = buf.get_u8();
33697 *v = val;
33698 }
33699 __struct.hw_version_major = buf.get_u8();
33700 __struct.hw_version_minor = buf.get_u8();
33701 for v in &mut __struct.hw_unique_id {
33702 let val = buf.get_u8();
33703 *v = val;
33704 }
33705 __struct.sw_version_major = buf.get_u8();
33706 __struct.sw_version_minor = buf.get_u8();
33707 Ok(__struct)
33708 }
33709 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33710 let mut __tmp = BytesMut::new(bytes);
33711 #[allow(clippy::absurd_extreme_comparisons)]
33712 #[allow(unused_comparisons)]
33713 if __tmp.remaining() < Self::ENCODED_LEN {
33714 panic!(
33715 "buffer is too small (need {} bytes, but got {})",
33716 Self::ENCODED_LEN,
33717 __tmp.remaining(),
33718 )
33719 }
33720 __tmp.put_u64_le(self.time_usec);
33721 __tmp.put_u32_le(self.uptime_sec);
33722 __tmp.put_u32_le(self.sw_vcs_commit);
33723 for val in &self.name {
33724 __tmp.put_u8(*val);
33725 }
33726 __tmp.put_u8(self.hw_version_major);
33727 __tmp.put_u8(self.hw_version_minor);
33728 for val in &self.hw_unique_id {
33729 __tmp.put_u8(*val);
33730 }
33731 __tmp.put_u8(self.sw_version_major);
33732 __tmp.put_u8(self.sw_version_minor);
33733 if matches!(version, MavlinkVersion::V2) {
33734 let len = __tmp.len();
33735 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33736 } else {
33737 __tmp.len()
33738 }
33739 }
33740}
33741#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
33742#[doc = ""]
33743#[doc = "ID: 310"]
33744#[derive(Debug, Clone, PartialEq)]
33745#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33746#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33747#[cfg_attr(feature = "ts", derive(TS))]
33748#[cfg_attr(feature = "ts", ts(export))]
33749pub struct UAVCAN_NODE_STATUS_DATA {
33750 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
33751 pub time_usec: u64,
33752 #[doc = "Time since the start-up of the node."]
33753 pub uptime_sec: u32,
33754 #[doc = "Vendor-specific status information."]
33755 pub vendor_specific_status_code: u16,
33756 #[doc = "Generalized node health status."]
33757 pub health: UavcanNodeHealth,
33758 #[doc = "Generalized operating mode."]
33759 pub mode: UavcanNodeMode,
33760 #[doc = "Not used currently."]
33761 pub sub_mode: u8,
33762}
33763impl UAVCAN_NODE_STATUS_DATA {
33764 pub const ENCODED_LEN: usize = 17usize;
33765 pub const DEFAULT: Self = Self {
33766 time_usec: 0_u64,
33767 uptime_sec: 0_u32,
33768 vendor_specific_status_code: 0_u16,
33769 health: UavcanNodeHealth::DEFAULT,
33770 mode: UavcanNodeMode::DEFAULT,
33771 sub_mode: 0_u8,
33772 };
33773 #[cfg(feature = "arbitrary")]
33774 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33775 use arbitrary::{Arbitrary, Unstructured};
33776 let mut buf = [0u8; 1024];
33777 rng.fill_bytes(&mut buf);
33778 let mut unstructured = Unstructured::new(&buf);
33779 Self::arbitrary(&mut unstructured).unwrap_or_default()
33780 }
33781}
33782impl Default for UAVCAN_NODE_STATUS_DATA {
33783 fn default() -> Self {
33784 Self::DEFAULT.clone()
33785 }
33786}
33787impl MessageData for UAVCAN_NODE_STATUS_DATA {
33788 type Message = MavMessage;
33789 const ID: u32 = 310u32;
33790 const NAME: &'static str = "UAVCAN_NODE_STATUS";
33791 const EXTRA_CRC: u8 = 28u8;
33792 const ENCODED_LEN: usize = 17usize;
33793 fn deser(
33794 _version: MavlinkVersion,
33795 __input: &[u8],
33796 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33797 let avail_len = __input.len();
33798 let mut payload_buf = [0; Self::ENCODED_LEN];
33799 let mut buf = if avail_len < Self::ENCODED_LEN {
33800 payload_buf[0..avail_len].copy_from_slice(__input);
33801 Bytes::new(&payload_buf)
33802 } else {
33803 Bytes::new(__input)
33804 };
33805 let mut __struct = Self::default();
33806 __struct.time_usec = buf.get_u64_le();
33807 __struct.uptime_sec = buf.get_u32_le();
33808 __struct.vendor_specific_status_code = buf.get_u16_le();
33809 let tmp = buf.get_u8();
33810 __struct.health =
33811 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
33812 enum_type: "UavcanNodeHealth",
33813 value: tmp as u32,
33814 })?;
33815 let tmp = buf.get_u8();
33816 __struct.mode =
33817 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
33818 enum_type: "UavcanNodeMode",
33819 value: tmp as u32,
33820 })?;
33821 __struct.sub_mode = buf.get_u8();
33822 Ok(__struct)
33823 }
33824 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33825 let mut __tmp = BytesMut::new(bytes);
33826 #[allow(clippy::absurd_extreme_comparisons)]
33827 #[allow(unused_comparisons)]
33828 if __tmp.remaining() < Self::ENCODED_LEN {
33829 panic!(
33830 "buffer is too small (need {} bytes, but got {})",
33831 Self::ENCODED_LEN,
33832 __tmp.remaining(),
33833 )
33834 }
33835 __tmp.put_u64_le(self.time_usec);
33836 __tmp.put_u32_le(self.uptime_sec);
33837 __tmp.put_u16_le(self.vendor_specific_status_code);
33838 __tmp.put_u8(self.health as u8);
33839 __tmp.put_u8(self.mode as u8);
33840 __tmp.put_u8(self.sub_mode);
33841 if matches!(version, MavlinkVersion::V2) {
33842 let len = __tmp.len();
33843 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33844 } else {
33845 __tmp.len()
33846 }
33847 }
33848}
33849#[doc = "The global position resulting from GPS and sensor fusion."]
33850#[doc = ""]
33851#[doc = "ID: 340"]
33852#[derive(Debug, Clone, PartialEq)]
33853#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33854#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33855#[cfg_attr(feature = "ts", derive(TS))]
33856#[cfg_attr(feature = "ts", ts(export))]
33857pub struct UTM_GLOBAL_POSITION_DATA {
33858 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
33859 pub time: u64,
33860 #[doc = "Latitude (WGS84)"]
33861 pub lat: i32,
33862 #[doc = "Longitude (WGS84)"]
33863 pub lon: i32,
33864 #[doc = "Altitude (WGS84)"]
33865 pub alt: i32,
33866 #[doc = "Altitude above ground"]
33867 pub relative_alt: i32,
33868 #[doc = "Next waypoint, latitude (WGS84)"]
33869 pub next_lat: i32,
33870 #[doc = "Next waypoint, longitude (WGS84)"]
33871 pub next_lon: i32,
33872 #[doc = "Next waypoint, altitude (WGS84)"]
33873 pub next_alt: i32,
33874 #[doc = "Ground X speed (latitude, positive north)"]
33875 pub vx: i16,
33876 #[doc = "Ground Y speed (longitude, positive east)"]
33877 pub vy: i16,
33878 #[doc = "Ground Z speed (altitude, positive down)"]
33879 pub vz: i16,
33880 #[doc = "Horizontal position uncertainty (standard deviation)"]
33881 pub h_acc: u16,
33882 #[doc = "Altitude uncertainty (standard deviation)"]
33883 pub v_acc: u16,
33884 #[doc = "Speed uncertainty (standard deviation)"]
33885 pub vel_acc: u16,
33886 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
33887 pub update_rate: u16,
33888 #[doc = "Unique UAS ID."]
33889 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33890 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33891 pub uas_id: [u8; 18],
33892 #[doc = "Flight state"]
33893 pub flight_state: UtmFlightState,
33894 #[doc = "Bitwise OR combination of the data available flags."]
33895 pub flags: UtmDataAvailFlags,
33896}
33897impl UTM_GLOBAL_POSITION_DATA {
33898 pub const ENCODED_LEN: usize = 70usize;
33899 pub const DEFAULT: Self = Self {
33900 time: 0_u64,
33901 lat: 0_i32,
33902 lon: 0_i32,
33903 alt: 0_i32,
33904 relative_alt: 0_i32,
33905 next_lat: 0_i32,
33906 next_lon: 0_i32,
33907 next_alt: 0_i32,
33908 vx: 0_i16,
33909 vy: 0_i16,
33910 vz: 0_i16,
33911 h_acc: 0_u16,
33912 v_acc: 0_u16,
33913 vel_acc: 0_u16,
33914 update_rate: 0_u16,
33915 uas_id: [0_u8; 18usize],
33916 flight_state: UtmFlightState::DEFAULT,
33917 flags: UtmDataAvailFlags::DEFAULT,
33918 };
33919 #[cfg(feature = "arbitrary")]
33920 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33921 use arbitrary::{Arbitrary, Unstructured};
33922 let mut buf = [0u8; 1024];
33923 rng.fill_bytes(&mut buf);
33924 let mut unstructured = Unstructured::new(&buf);
33925 Self::arbitrary(&mut unstructured).unwrap_or_default()
33926 }
33927}
33928impl Default for UTM_GLOBAL_POSITION_DATA {
33929 fn default() -> Self {
33930 Self::DEFAULT.clone()
33931 }
33932}
33933impl MessageData for UTM_GLOBAL_POSITION_DATA {
33934 type Message = MavMessage;
33935 const ID: u32 = 340u32;
33936 const NAME: &'static str = "UTM_GLOBAL_POSITION";
33937 const EXTRA_CRC: u8 = 99u8;
33938 const ENCODED_LEN: usize = 70usize;
33939 fn deser(
33940 _version: MavlinkVersion,
33941 __input: &[u8],
33942 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33943 let avail_len = __input.len();
33944 let mut payload_buf = [0; Self::ENCODED_LEN];
33945 let mut buf = if avail_len < Self::ENCODED_LEN {
33946 payload_buf[0..avail_len].copy_from_slice(__input);
33947 Bytes::new(&payload_buf)
33948 } else {
33949 Bytes::new(__input)
33950 };
33951 let mut __struct = Self::default();
33952 __struct.time = buf.get_u64_le();
33953 __struct.lat = buf.get_i32_le();
33954 __struct.lon = buf.get_i32_le();
33955 __struct.alt = buf.get_i32_le();
33956 __struct.relative_alt = buf.get_i32_le();
33957 __struct.next_lat = buf.get_i32_le();
33958 __struct.next_lon = buf.get_i32_le();
33959 __struct.next_alt = buf.get_i32_le();
33960 __struct.vx = buf.get_i16_le();
33961 __struct.vy = buf.get_i16_le();
33962 __struct.vz = buf.get_i16_le();
33963 __struct.h_acc = buf.get_u16_le();
33964 __struct.v_acc = buf.get_u16_le();
33965 __struct.vel_acc = buf.get_u16_le();
33966 __struct.update_rate = buf.get_u16_le();
33967 for v in &mut __struct.uas_id {
33968 let val = buf.get_u8();
33969 *v = val;
33970 }
33971 let tmp = buf.get_u8();
33972 __struct.flight_state =
33973 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
33974 enum_type: "UtmFlightState",
33975 value: tmp as u32,
33976 })?;
33977 let tmp = buf.get_u8();
33978 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
33979 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
33980 flag_type: "UtmDataAvailFlags",
33981 value: tmp as u32,
33982 })?;
33983 Ok(__struct)
33984 }
33985 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33986 let mut __tmp = BytesMut::new(bytes);
33987 #[allow(clippy::absurd_extreme_comparisons)]
33988 #[allow(unused_comparisons)]
33989 if __tmp.remaining() < Self::ENCODED_LEN {
33990 panic!(
33991 "buffer is too small (need {} bytes, but got {})",
33992 Self::ENCODED_LEN,
33993 __tmp.remaining(),
33994 )
33995 }
33996 __tmp.put_u64_le(self.time);
33997 __tmp.put_i32_le(self.lat);
33998 __tmp.put_i32_le(self.lon);
33999 __tmp.put_i32_le(self.alt);
34000 __tmp.put_i32_le(self.relative_alt);
34001 __tmp.put_i32_le(self.next_lat);
34002 __tmp.put_i32_le(self.next_lon);
34003 __tmp.put_i32_le(self.next_alt);
34004 __tmp.put_i16_le(self.vx);
34005 __tmp.put_i16_le(self.vy);
34006 __tmp.put_i16_le(self.vz);
34007 __tmp.put_u16_le(self.h_acc);
34008 __tmp.put_u16_le(self.v_acc);
34009 __tmp.put_u16_le(self.vel_acc);
34010 __tmp.put_u16_le(self.update_rate);
34011 for val in &self.uas_id {
34012 __tmp.put_u8(*val);
34013 }
34014 __tmp.put_u8(self.flight_state as u8);
34015 __tmp.put_u8(self.flags.bits());
34016 if matches!(version, MavlinkVersion::V2) {
34017 let len = __tmp.len();
34018 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34019 } else {
34020 __tmp.len()
34021 }
34022 }
34023}
34024#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
34025#[doc = ""]
34026#[doc = "ID: 248"]
34027#[derive(Debug, Clone, PartialEq)]
34028#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34029#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34030#[cfg_attr(feature = "ts", derive(TS))]
34031#[cfg_attr(feature = "ts", ts(export))]
34032pub struct V2_EXTENSION_DATA {
34033 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
34034 pub message_type: u16,
34035 #[doc = "Network ID (0 for broadcast)"]
34036 pub target_network: u8,
34037 #[doc = "System ID (0 for broadcast)"]
34038 pub target_system: u8,
34039 #[doc = "Component ID (0 for broadcast)"]
34040 pub target_component: u8,
34041 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
34042 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
34043 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
34044 pub payload: [u8; 249],
34045}
34046impl V2_EXTENSION_DATA {
34047 pub const ENCODED_LEN: usize = 254usize;
34048 pub const DEFAULT: Self = Self {
34049 message_type: 0_u16,
34050 target_network: 0_u8,
34051 target_system: 0_u8,
34052 target_component: 0_u8,
34053 payload: [0_u8; 249usize],
34054 };
34055 #[cfg(feature = "arbitrary")]
34056 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34057 use arbitrary::{Arbitrary, Unstructured};
34058 let mut buf = [0u8; 1024];
34059 rng.fill_bytes(&mut buf);
34060 let mut unstructured = Unstructured::new(&buf);
34061 Self::arbitrary(&mut unstructured).unwrap_or_default()
34062 }
34063}
34064impl Default for V2_EXTENSION_DATA {
34065 fn default() -> Self {
34066 Self::DEFAULT.clone()
34067 }
34068}
34069impl MessageData for V2_EXTENSION_DATA {
34070 type Message = MavMessage;
34071 const ID: u32 = 248u32;
34072 const NAME: &'static str = "V2_EXTENSION";
34073 const EXTRA_CRC: u8 = 8u8;
34074 const ENCODED_LEN: usize = 254usize;
34075 fn deser(
34076 _version: MavlinkVersion,
34077 __input: &[u8],
34078 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34079 let avail_len = __input.len();
34080 let mut payload_buf = [0; Self::ENCODED_LEN];
34081 let mut buf = if avail_len < Self::ENCODED_LEN {
34082 payload_buf[0..avail_len].copy_from_slice(__input);
34083 Bytes::new(&payload_buf)
34084 } else {
34085 Bytes::new(__input)
34086 };
34087 let mut __struct = Self::default();
34088 __struct.message_type = buf.get_u16_le();
34089 __struct.target_network = buf.get_u8();
34090 __struct.target_system = buf.get_u8();
34091 __struct.target_component = buf.get_u8();
34092 for v in &mut __struct.payload {
34093 let val = buf.get_u8();
34094 *v = val;
34095 }
34096 Ok(__struct)
34097 }
34098 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34099 let mut __tmp = BytesMut::new(bytes);
34100 #[allow(clippy::absurd_extreme_comparisons)]
34101 #[allow(unused_comparisons)]
34102 if __tmp.remaining() < Self::ENCODED_LEN {
34103 panic!(
34104 "buffer is too small (need {} bytes, but got {})",
34105 Self::ENCODED_LEN,
34106 __tmp.remaining(),
34107 )
34108 }
34109 __tmp.put_u16_le(self.message_type);
34110 __tmp.put_u8(self.target_network);
34111 __tmp.put_u8(self.target_system);
34112 __tmp.put_u8(self.target_component);
34113 for val in &self.payload {
34114 __tmp.put_u8(*val);
34115 }
34116 if matches!(version, MavlinkVersion::V2) {
34117 let len = __tmp.len();
34118 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34119 } else {
34120 __tmp.len()
34121 }
34122 }
34123}
34124#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
34125#[doc = ""]
34126#[doc = "ID: 74"]
34127#[derive(Debug, Clone, PartialEq)]
34128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34129#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34130#[cfg_attr(feature = "ts", derive(TS))]
34131#[cfg_attr(feature = "ts", ts(export))]
34132pub struct VFR_HUD_DATA {
34133 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
34134 pub airspeed: f32,
34135 #[doc = "Current ground speed."]
34136 pub groundspeed: f32,
34137 #[doc = "Current altitude (MSL)."]
34138 pub alt: f32,
34139 #[doc = "Current climb rate."]
34140 pub climb: f32,
34141 #[doc = "Current heading in compass units (0-360, 0=north)."]
34142 pub heading: i16,
34143 #[doc = "Current throttle setting (0 to 100)."]
34144 pub throttle: u16,
34145}
34146impl VFR_HUD_DATA {
34147 pub const ENCODED_LEN: usize = 20usize;
34148 pub const DEFAULT: Self = Self {
34149 airspeed: 0.0_f32,
34150 groundspeed: 0.0_f32,
34151 alt: 0.0_f32,
34152 climb: 0.0_f32,
34153 heading: 0_i16,
34154 throttle: 0_u16,
34155 };
34156 #[cfg(feature = "arbitrary")]
34157 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34158 use arbitrary::{Arbitrary, Unstructured};
34159 let mut buf = [0u8; 1024];
34160 rng.fill_bytes(&mut buf);
34161 let mut unstructured = Unstructured::new(&buf);
34162 Self::arbitrary(&mut unstructured).unwrap_or_default()
34163 }
34164}
34165impl Default for VFR_HUD_DATA {
34166 fn default() -> Self {
34167 Self::DEFAULT.clone()
34168 }
34169}
34170impl MessageData for VFR_HUD_DATA {
34171 type Message = MavMessage;
34172 const ID: u32 = 74u32;
34173 const NAME: &'static str = "VFR_HUD";
34174 const EXTRA_CRC: u8 = 20u8;
34175 const ENCODED_LEN: usize = 20usize;
34176 fn deser(
34177 _version: MavlinkVersion,
34178 __input: &[u8],
34179 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34180 let avail_len = __input.len();
34181 let mut payload_buf = [0; Self::ENCODED_LEN];
34182 let mut buf = if avail_len < Self::ENCODED_LEN {
34183 payload_buf[0..avail_len].copy_from_slice(__input);
34184 Bytes::new(&payload_buf)
34185 } else {
34186 Bytes::new(__input)
34187 };
34188 let mut __struct = Self::default();
34189 __struct.airspeed = buf.get_f32_le();
34190 __struct.groundspeed = buf.get_f32_le();
34191 __struct.alt = buf.get_f32_le();
34192 __struct.climb = buf.get_f32_le();
34193 __struct.heading = buf.get_i16_le();
34194 __struct.throttle = buf.get_u16_le();
34195 Ok(__struct)
34196 }
34197 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34198 let mut __tmp = BytesMut::new(bytes);
34199 #[allow(clippy::absurd_extreme_comparisons)]
34200 #[allow(unused_comparisons)]
34201 if __tmp.remaining() < Self::ENCODED_LEN {
34202 panic!(
34203 "buffer is too small (need {} bytes, but got {})",
34204 Self::ENCODED_LEN,
34205 __tmp.remaining(),
34206 )
34207 }
34208 __tmp.put_f32_le(self.airspeed);
34209 __tmp.put_f32_le(self.groundspeed);
34210 __tmp.put_f32_le(self.alt);
34211 __tmp.put_f32_le(self.climb);
34212 __tmp.put_i16_le(self.heading);
34213 __tmp.put_u16_le(self.throttle);
34214 if matches!(version, MavlinkVersion::V2) {
34215 let len = __tmp.len();
34216 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34217 } else {
34218 __tmp.len()
34219 }
34220 }
34221}
34222#[doc = "Vibration levels and accelerometer clipping."]
34223#[doc = ""]
34224#[doc = "ID: 241"]
34225#[derive(Debug, Clone, PartialEq)]
34226#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34227#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34228#[cfg_attr(feature = "ts", derive(TS))]
34229#[cfg_attr(feature = "ts", ts(export))]
34230pub struct VIBRATION_DATA {
34231 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
34232 pub time_usec: u64,
34233 #[doc = "Vibration levels on X-axis"]
34234 pub vibration_x: f32,
34235 #[doc = "Vibration levels on Y-axis"]
34236 pub vibration_y: f32,
34237 #[doc = "Vibration levels on Z-axis"]
34238 pub vibration_z: f32,
34239 #[doc = "first accelerometer clipping count"]
34240 pub clipping_0: u32,
34241 #[doc = "second accelerometer clipping count"]
34242 pub clipping_1: u32,
34243 #[doc = "third accelerometer clipping count"]
34244 pub clipping_2: u32,
34245}
34246impl VIBRATION_DATA {
34247 pub const ENCODED_LEN: usize = 32usize;
34248 pub const DEFAULT: Self = Self {
34249 time_usec: 0_u64,
34250 vibration_x: 0.0_f32,
34251 vibration_y: 0.0_f32,
34252 vibration_z: 0.0_f32,
34253 clipping_0: 0_u32,
34254 clipping_1: 0_u32,
34255 clipping_2: 0_u32,
34256 };
34257 #[cfg(feature = "arbitrary")]
34258 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34259 use arbitrary::{Arbitrary, Unstructured};
34260 let mut buf = [0u8; 1024];
34261 rng.fill_bytes(&mut buf);
34262 let mut unstructured = Unstructured::new(&buf);
34263 Self::arbitrary(&mut unstructured).unwrap_or_default()
34264 }
34265}
34266impl Default for VIBRATION_DATA {
34267 fn default() -> Self {
34268 Self::DEFAULT.clone()
34269 }
34270}
34271impl MessageData for VIBRATION_DATA {
34272 type Message = MavMessage;
34273 const ID: u32 = 241u32;
34274 const NAME: &'static str = "VIBRATION";
34275 const EXTRA_CRC: u8 = 90u8;
34276 const ENCODED_LEN: usize = 32usize;
34277 fn deser(
34278 _version: MavlinkVersion,
34279 __input: &[u8],
34280 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34281 let avail_len = __input.len();
34282 let mut payload_buf = [0; Self::ENCODED_LEN];
34283 let mut buf = if avail_len < Self::ENCODED_LEN {
34284 payload_buf[0..avail_len].copy_from_slice(__input);
34285 Bytes::new(&payload_buf)
34286 } else {
34287 Bytes::new(__input)
34288 };
34289 let mut __struct = Self::default();
34290 __struct.time_usec = buf.get_u64_le();
34291 __struct.vibration_x = buf.get_f32_le();
34292 __struct.vibration_y = buf.get_f32_le();
34293 __struct.vibration_z = buf.get_f32_le();
34294 __struct.clipping_0 = buf.get_u32_le();
34295 __struct.clipping_1 = buf.get_u32_le();
34296 __struct.clipping_2 = buf.get_u32_le();
34297 Ok(__struct)
34298 }
34299 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34300 let mut __tmp = BytesMut::new(bytes);
34301 #[allow(clippy::absurd_extreme_comparisons)]
34302 #[allow(unused_comparisons)]
34303 if __tmp.remaining() < Self::ENCODED_LEN {
34304 panic!(
34305 "buffer is too small (need {} bytes, but got {})",
34306 Self::ENCODED_LEN,
34307 __tmp.remaining(),
34308 )
34309 }
34310 __tmp.put_u64_le(self.time_usec);
34311 __tmp.put_f32_le(self.vibration_x);
34312 __tmp.put_f32_le(self.vibration_y);
34313 __tmp.put_f32_le(self.vibration_z);
34314 __tmp.put_u32_le(self.clipping_0);
34315 __tmp.put_u32_le(self.clipping_1);
34316 __tmp.put_u32_le(self.clipping_2);
34317 if matches!(version, MavlinkVersion::V2) {
34318 let len = __tmp.len();
34319 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34320 } else {
34321 __tmp.len()
34322 }
34323 }
34324}
34325#[doc = "Global position estimate from a Vicon motion system source."]
34326#[doc = ""]
34327#[doc = "ID: 104"]
34328#[derive(Debug, Clone, PartialEq)]
34329#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34330#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34331#[cfg_attr(feature = "ts", derive(TS))]
34332#[cfg_attr(feature = "ts", ts(export))]
34333pub struct VICON_POSITION_ESTIMATE_DATA {
34334 #[doc = "Timestamp (UNIX time or time since system boot)"]
34335 pub usec: u64,
34336 #[doc = "Global X position"]
34337 pub x: f32,
34338 #[doc = "Global Y position"]
34339 pub y: f32,
34340 #[doc = "Global Z position"]
34341 pub z: f32,
34342 #[doc = "Roll angle"]
34343 pub roll: f32,
34344 #[doc = "Pitch angle"]
34345 pub pitch: f32,
34346 #[doc = "Yaw angle"]
34347 pub yaw: f32,
34348 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
34349 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
34350 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
34351 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
34352 pub covariance: [f32; 21],
34353}
34354impl VICON_POSITION_ESTIMATE_DATA {
34355 pub const ENCODED_LEN: usize = 116usize;
34356 pub const DEFAULT: Self = Self {
34357 usec: 0_u64,
34358 x: 0.0_f32,
34359 y: 0.0_f32,
34360 z: 0.0_f32,
34361 roll: 0.0_f32,
34362 pitch: 0.0_f32,
34363 yaw: 0.0_f32,
34364 covariance: [0.0_f32; 21usize],
34365 };
34366 #[cfg(feature = "arbitrary")]
34367 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34368 use arbitrary::{Arbitrary, Unstructured};
34369 let mut buf = [0u8; 1024];
34370 rng.fill_bytes(&mut buf);
34371 let mut unstructured = Unstructured::new(&buf);
34372 Self::arbitrary(&mut unstructured).unwrap_or_default()
34373 }
34374}
34375impl Default for VICON_POSITION_ESTIMATE_DATA {
34376 fn default() -> Self {
34377 Self::DEFAULT.clone()
34378 }
34379}
34380impl MessageData for VICON_POSITION_ESTIMATE_DATA {
34381 type Message = MavMessage;
34382 const ID: u32 = 104u32;
34383 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
34384 const EXTRA_CRC: u8 = 56u8;
34385 const ENCODED_LEN: usize = 116usize;
34386 fn deser(
34387 _version: MavlinkVersion,
34388 __input: &[u8],
34389 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34390 let avail_len = __input.len();
34391 let mut payload_buf = [0; Self::ENCODED_LEN];
34392 let mut buf = if avail_len < Self::ENCODED_LEN {
34393 payload_buf[0..avail_len].copy_from_slice(__input);
34394 Bytes::new(&payload_buf)
34395 } else {
34396 Bytes::new(__input)
34397 };
34398 let mut __struct = Self::default();
34399 __struct.usec = buf.get_u64_le();
34400 __struct.x = buf.get_f32_le();
34401 __struct.y = buf.get_f32_le();
34402 __struct.z = buf.get_f32_le();
34403 __struct.roll = buf.get_f32_le();
34404 __struct.pitch = buf.get_f32_le();
34405 __struct.yaw = buf.get_f32_le();
34406 for v in &mut __struct.covariance {
34407 let val = buf.get_f32_le();
34408 *v = val;
34409 }
34410 Ok(__struct)
34411 }
34412 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34413 let mut __tmp = BytesMut::new(bytes);
34414 #[allow(clippy::absurd_extreme_comparisons)]
34415 #[allow(unused_comparisons)]
34416 if __tmp.remaining() < Self::ENCODED_LEN {
34417 panic!(
34418 "buffer is too small (need {} bytes, but got {})",
34419 Self::ENCODED_LEN,
34420 __tmp.remaining(),
34421 )
34422 }
34423 __tmp.put_u64_le(self.usec);
34424 __tmp.put_f32_le(self.x);
34425 __tmp.put_f32_le(self.y);
34426 __tmp.put_f32_le(self.z);
34427 __tmp.put_f32_le(self.roll);
34428 __tmp.put_f32_le(self.pitch);
34429 __tmp.put_f32_le(self.yaw);
34430 if matches!(version, MavlinkVersion::V2) {
34431 for val in &self.covariance {
34432 __tmp.put_f32_le(*val);
34433 }
34434 let len = __tmp.len();
34435 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34436 } else {
34437 __tmp.len()
34438 }
34439 }
34440}
34441#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
34442#[doc = ""]
34443#[doc = "ID: 269"]
34444#[derive(Debug, Clone, PartialEq)]
34445#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34446#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34447#[cfg_attr(feature = "ts", derive(TS))]
34448#[cfg_attr(feature = "ts", ts(export))]
34449pub struct VIDEO_STREAM_INFORMATION_DATA {
34450 #[doc = "Frame rate."]
34451 pub framerate: f32,
34452 #[doc = "Bit rate."]
34453 pub bitrate: u32,
34454 #[doc = "Bitmap of stream status flags."]
34455 pub flags: VideoStreamStatusFlags,
34456 #[doc = "Horizontal resolution."]
34457 pub resolution_h: u16,
34458 #[doc = "Vertical resolution."]
34459 pub resolution_v: u16,
34460 #[doc = "Video image rotation clockwise."]
34461 pub rotation: u16,
34462 #[doc = "Horizontal Field of view."]
34463 pub hfov: u16,
34464 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
34465 pub stream_id: u8,
34466 #[doc = "Number of streams available."]
34467 pub count: u8,
34468 #[doc = "Type of stream."]
34469 pub mavtype: VideoStreamType,
34470 #[doc = "Stream name."]
34471 #[cfg_attr(
34472 feature = "serde",
34473 serde(
34474 serialize_with = "crate::nulstr::serialize::<_, 32>",
34475 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
34476 )
34477 )]
34478 #[cfg_attr(feature = "ts", ts(type = "string"))]
34479 pub name: [u8; 32],
34480 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
34481 #[cfg_attr(
34482 feature = "serde",
34483 serde(
34484 serialize_with = "crate::nulstr::serialize::<_, 160>",
34485 deserialize_with = "crate::nulstr::deserialize::<_, 160>"
34486 )
34487 )]
34488 #[cfg_attr(feature = "ts", ts(type = "string"))]
34489 pub uri: [u8; 160],
34490 #[doc = "Encoding of stream."]
34491 #[cfg_attr(feature = "serde", serde(default))]
34492 pub encoding: VideoStreamEncoding,
34493 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
34494 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
34495 pub camera_device_id: u8,
34496}
34497impl VIDEO_STREAM_INFORMATION_DATA {
34498 pub const ENCODED_LEN: usize = 215usize;
34499 pub const DEFAULT: Self = Self {
34500 framerate: 0.0_f32,
34501 bitrate: 0_u32,
34502 flags: VideoStreamStatusFlags::DEFAULT,
34503 resolution_h: 0_u16,
34504 resolution_v: 0_u16,
34505 rotation: 0_u16,
34506 hfov: 0_u16,
34507 stream_id: 0_u8,
34508 count: 0_u8,
34509 mavtype: VideoStreamType::DEFAULT,
34510 name: [0_u8; 32usize],
34511 uri: [0_u8; 160usize],
34512 encoding: VideoStreamEncoding::DEFAULT,
34513 camera_device_id: 0_u8,
34514 };
34515 #[cfg(feature = "arbitrary")]
34516 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34517 use arbitrary::{Arbitrary, Unstructured};
34518 let mut buf = [0u8; 1024];
34519 rng.fill_bytes(&mut buf);
34520 let mut unstructured = Unstructured::new(&buf);
34521 Self::arbitrary(&mut unstructured).unwrap_or_default()
34522 }
34523}
34524impl Default for VIDEO_STREAM_INFORMATION_DATA {
34525 fn default() -> Self {
34526 Self::DEFAULT.clone()
34527 }
34528}
34529impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
34530 type Message = MavMessage;
34531 const ID: u32 = 269u32;
34532 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
34533 const EXTRA_CRC: u8 = 109u8;
34534 const ENCODED_LEN: usize = 215usize;
34535 fn deser(
34536 _version: MavlinkVersion,
34537 __input: &[u8],
34538 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34539 let avail_len = __input.len();
34540 let mut payload_buf = [0; Self::ENCODED_LEN];
34541 let mut buf = if avail_len < Self::ENCODED_LEN {
34542 payload_buf[0..avail_len].copy_from_slice(__input);
34543 Bytes::new(&payload_buf)
34544 } else {
34545 Bytes::new(__input)
34546 };
34547 let mut __struct = Self::default();
34548 __struct.framerate = buf.get_f32_le();
34549 __struct.bitrate = buf.get_u32_le();
34550 let tmp = buf.get_u16_le();
34551 __struct.flags = VideoStreamStatusFlags::from_bits(
34552 tmp & VideoStreamStatusFlags::all().bits(),
34553 )
34554 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
34555 flag_type: "VideoStreamStatusFlags",
34556 value: tmp as u32,
34557 })?;
34558 __struct.resolution_h = buf.get_u16_le();
34559 __struct.resolution_v = buf.get_u16_le();
34560 __struct.rotation = buf.get_u16_le();
34561 __struct.hfov = buf.get_u16_le();
34562 __struct.stream_id = buf.get_u8();
34563 __struct.count = buf.get_u8();
34564 let tmp = buf.get_u8();
34565 __struct.mavtype =
34566 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
34567 enum_type: "VideoStreamType",
34568 value: tmp as u32,
34569 })?;
34570 for v in &mut __struct.name {
34571 let val = buf.get_u8();
34572 *v = val;
34573 }
34574 for v in &mut __struct.uri {
34575 let val = buf.get_u8();
34576 *v = val;
34577 }
34578 let tmp = buf.get_u8();
34579 __struct.encoding =
34580 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
34581 enum_type: "VideoStreamEncoding",
34582 value: tmp as u32,
34583 })?;
34584 __struct.camera_device_id = buf.get_u8();
34585 Ok(__struct)
34586 }
34587 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34588 let mut __tmp = BytesMut::new(bytes);
34589 #[allow(clippy::absurd_extreme_comparisons)]
34590 #[allow(unused_comparisons)]
34591 if __tmp.remaining() < Self::ENCODED_LEN {
34592 panic!(
34593 "buffer is too small (need {} bytes, but got {})",
34594 Self::ENCODED_LEN,
34595 __tmp.remaining(),
34596 )
34597 }
34598 __tmp.put_f32_le(self.framerate);
34599 __tmp.put_u32_le(self.bitrate);
34600 __tmp.put_u16_le(self.flags.bits());
34601 __tmp.put_u16_le(self.resolution_h);
34602 __tmp.put_u16_le(self.resolution_v);
34603 __tmp.put_u16_le(self.rotation);
34604 __tmp.put_u16_le(self.hfov);
34605 __tmp.put_u8(self.stream_id);
34606 __tmp.put_u8(self.count);
34607 __tmp.put_u8(self.mavtype as u8);
34608 for val in &self.name {
34609 __tmp.put_u8(*val);
34610 }
34611 for val in &self.uri {
34612 __tmp.put_u8(*val);
34613 }
34614 if matches!(version, MavlinkVersion::V2) {
34615 __tmp.put_u8(self.encoding as u8);
34616 __tmp.put_u8(self.camera_device_id);
34617 let len = __tmp.len();
34618 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34619 } else {
34620 __tmp.len()
34621 }
34622 }
34623}
34624#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
34625#[doc = ""]
34626#[doc = "ID: 270"]
34627#[derive(Debug, Clone, PartialEq)]
34628#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34629#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34630#[cfg_attr(feature = "ts", derive(TS))]
34631#[cfg_attr(feature = "ts", ts(export))]
34632pub struct VIDEO_STREAM_STATUS_DATA {
34633 #[doc = "Frame rate"]
34634 pub framerate: f32,
34635 #[doc = "Bit rate"]
34636 pub bitrate: u32,
34637 #[doc = "Bitmap of stream status flags"]
34638 pub flags: VideoStreamStatusFlags,
34639 #[doc = "Horizontal resolution"]
34640 pub resolution_h: u16,
34641 #[doc = "Vertical resolution"]
34642 pub resolution_v: u16,
34643 #[doc = "Video image rotation clockwise"]
34644 pub rotation: u16,
34645 #[doc = "Horizontal Field of view"]
34646 pub hfov: u16,
34647 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
34648 pub stream_id: u8,
34649 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
34650 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
34651 pub camera_device_id: u8,
34652}
34653impl VIDEO_STREAM_STATUS_DATA {
34654 pub const ENCODED_LEN: usize = 20usize;
34655 pub const DEFAULT: Self = Self {
34656 framerate: 0.0_f32,
34657 bitrate: 0_u32,
34658 flags: VideoStreamStatusFlags::DEFAULT,
34659 resolution_h: 0_u16,
34660 resolution_v: 0_u16,
34661 rotation: 0_u16,
34662 hfov: 0_u16,
34663 stream_id: 0_u8,
34664 camera_device_id: 0_u8,
34665 };
34666 #[cfg(feature = "arbitrary")]
34667 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34668 use arbitrary::{Arbitrary, Unstructured};
34669 let mut buf = [0u8; 1024];
34670 rng.fill_bytes(&mut buf);
34671 let mut unstructured = Unstructured::new(&buf);
34672 Self::arbitrary(&mut unstructured).unwrap_or_default()
34673 }
34674}
34675impl Default for VIDEO_STREAM_STATUS_DATA {
34676 fn default() -> Self {
34677 Self::DEFAULT.clone()
34678 }
34679}
34680impl MessageData for VIDEO_STREAM_STATUS_DATA {
34681 type Message = MavMessage;
34682 const ID: u32 = 270u32;
34683 const NAME: &'static str = "VIDEO_STREAM_STATUS";
34684 const EXTRA_CRC: u8 = 59u8;
34685 const ENCODED_LEN: usize = 20usize;
34686 fn deser(
34687 _version: MavlinkVersion,
34688 __input: &[u8],
34689 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34690 let avail_len = __input.len();
34691 let mut payload_buf = [0; Self::ENCODED_LEN];
34692 let mut buf = if avail_len < Self::ENCODED_LEN {
34693 payload_buf[0..avail_len].copy_from_slice(__input);
34694 Bytes::new(&payload_buf)
34695 } else {
34696 Bytes::new(__input)
34697 };
34698 let mut __struct = Self::default();
34699 __struct.framerate = buf.get_f32_le();
34700 __struct.bitrate = buf.get_u32_le();
34701 let tmp = buf.get_u16_le();
34702 __struct.flags = VideoStreamStatusFlags::from_bits(
34703 tmp & VideoStreamStatusFlags::all().bits(),
34704 )
34705 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
34706 flag_type: "VideoStreamStatusFlags",
34707 value: tmp as u32,
34708 })?;
34709 __struct.resolution_h = buf.get_u16_le();
34710 __struct.resolution_v = buf.get_u16_le();
34711 __struct.rotation = buf.get_u16_le();
34712 __struct.hfov = buf.get_u16_le();
34713 __struct.stream_id = buf.get_u8();
34714 __struct.camera_device_id = buf.get_u8();
34715 Ok(__struct)
34716 }
34717 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34718 let mut __tmp = BytesMut::new(bytes);
34719 #[allow(clippy::absurd_extreme_comparisons)]
34720 #[allow(unused_comparisons)]
34721 if __tmp.remaining() < Self::ENCODED_LEN {
34722 panic!(
34723 "buffer is too small (need {} bytes, but got {})",
34724 Self::ENCODED_LEN,
34725 __tmp.remaining(),
34726 )
34727 }
34728 __tmp.put_f32_le(self.framerate);
34729 __tmp.put_u32_le(self.bitrate);
34730 __tmp.put_u16_le(self.flags.bits());
34731 __tmp.put_u16_le(self.resolution_h);
34732 __tmp.put_u16_le(self.resolution_v);
34733 __tmp.put_u16_le(self.rotation);
34734 __tmp.put_u16_le(self.hfov);
34735 __tmp.put_u8(self.stream_id);
34736 if matches!(version, MavlinkVersion::V2) {
34737 __tmp.put_u8(self.camera_device_id);
34738 let len = __tmp.len();
34739 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34740 } else {
34741 __tmp.len()
34742 }
34743 }
34744}
34745#[doc = "Local position/attitude estimate from a vision source."]
34746#[doc = ""]
34747#[doc = "ID: 102"]
34748#[derive(Debug, Clone, PartialEq)]
34749#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34750#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34751#[cfg_attr(feature = "ts", derive(TS))]
34752#[cfg_attr(feature = "ts", ts(export))]
34753pub struct VISION_POSITION_ESTIMATE_DATA {
34754 #[doc = "Timestamp (UNIX time or time since system boot)"]
34755 pub usec: u64,
34756 #[doc = "Local X position"]
34757 pub x: f32,
34758 #[doc = "Local Y position"]
34759 pub y: f32,
34760 #[doc = "Local Z position"]
34761 pub z: f32,
34762 #[doc = "Roll angle"]
34763 pub roll: f32,
34764 #[doc = "Pitch angle"]
34765 pub pitch: f32,
34766 #[doc = "Yaw angle"]
34767 pub yaw: f32,
34768 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
34769 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
34770 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
34771 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
34772 pub covariance: [f32; 21],
34773 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
34774 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
34775 pub reset_counter: u8,
34776}
34777impl VISION_POSITION_ESTIMATE_DATA {
34778 pub const ENCODED_LEN: usize = 117usize;
34779 pub const DEFAULT: Self = Self {
34780 usec: 0_u64,
34781 x: 0.0_f32,
34782 y: 0.0_f32,
34783 z: 0.0_f32,
34784 roll: 0.0_f32,
34785 pitch: 0.0_f32,
34786 yaw: 0.0_f32,
34787 covariance: [0.0_f32; 21usize],
34788 reset_counter: 0_u8,
34789 };
34790 #[cfg(feature = "arbitrary")]
34791 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34792 use arbitrary::{Arbitrary, Unstructured};
34793 let mut buf = [0u8; 1024];
34794 rng.fill_bytes(&mut buf);
34795 let mut unstructured = Unstructured::new(&buf);
34796 Self::arbitrary(&mut unstructured).unwrap_or_default()
34797 }
34798}
34799impl Default for VISION_POSITION_ESTIMATE_DATA {
34800 fn default() -> Self {
34801 Self::DEFAULT.clone()
34802 }
34803}
34804impl MessageData for VISION_POSITION_ESTIMATE_DATA {
34805 type Message = MavMessage;
34806 const ID: u32 = 102u32;
34807 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
34808 const EXTRA_CRC: u8 = 158u8;
34809 const ENCODED_LEN: usize = 117usize;
34810 fn deser(
34811 _version: MavlinkVersion,
34812 __input: &[u8],
34813 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34814 let avail_len = __input.len();
34815 let mut payload_buf = [0; Self::ENCODED_LEN];
34816 let mut buf = if avail_len < Self::ENCODED_LEN {
34817 payload_buf[0..avail_len].copy_from_slice(__input);
34818 Bytes::new(&payload_buf)
34819 } else {
34820 Bytes::new(__input)
34821 };
34822 let mut __struct = Self::default();
34823 __struct.usec = buf.get_u64_le();
34824 __struct.x = buf.get_f32_le();
34825 __struct.y = buf.get_f32_le();
34826 __struct.z = buf.get_f32_le();
34827 __struct.roll = buf.get_f32_le();
34828 __struct.pitch = buf.get_f32_le();
34829 __struct.yaw = buf.get_f32_le();
34830 for v in &mut __struct.covariance {
34831 let val = buf.get_f32_le();
34832 *v = val;
34833 }
34834 __struct.reset_counter = buf.get_u8();
34835 Ok(__struct)
34836 }
34837 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34838 let mut __tmp = BytesMut::new(bytes);
34839 #[allow(clippy::absurd_extreme_comparisons)]
34840 #[allow(unused_comparisons)]
34841 if __tmp.remaining() < Self::ENCODED_LEN {
34842 panic!(
34843 "buffer is too small (need {} bytes, but got {})",
34844 Self::ENCODED_LEN,
34845 __tmp.remaining(),
34846 )
34847 }
34848 __tmp.put_u64_le(self.usec);
34849 __tmp.put_f32_le(self.x);
34850 __tmp.put_f32_le(self.y);
34851 __tmp.put_f32_le(self.z);
34852 __tmp.put_f32_le(self.roll);
34853 __tmp.put_f32_le(self.pitch);
34854 __tmp.put_f32_le(self.yaw);
34855 if matches!(version, MavlinkVersion::V2) {
34856 for val in &self.covariance {
34857 __tmp.put_f32_le(*val);
34858 }
34859 __tmp.put_u8(self.reset_counter);
34860 let len = __tmp.len();
34861 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34862 } else {
34863 __tmp.len()
34864 }
34865 }
34866}
34867#[doc = "Speed estimate from a vision source."]
34868#[doc = ""]
34869#[doc = "ID: 103"]
34870#[derive(Debug, Clone, PartialEq)]
34871#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34872#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34873#[cfg_attr(feature = "ts", derive(TS))]
34874#[cfg_attr(feature = "ts", ts(export))]
34875pub struct VISION_SPEED_ESTIMATE_DATA {
34876 #[doc = "Timestamp (UNIX time or time since system boot)"]
34877 pub usec: u64,
34878 #[doc = "Global X speed"]
34879 pub x: f32,
34880 #[doc = "Global Y speed"]
34881 pub y: f32,
34882 #[doc = "Global Z speed"]
34883 pub z: f32,
34884 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
34885 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
34886 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
34887 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
34888 pub covariance: [f32; 9],
34889 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
34890 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
34891 pub reset_counter: u8,
34892}
34893impl VISION_SPEED_ESTIMATE_DATA {
34894 pub const ENCODED_LEN: usize = 57usize;
34895 pub const DEFAULT: Self = Self {
34896 usec: 0_u64,
34897 x: 0.0_f32,
34898 y: 0.0_f32,
34899 z: 0.0_f32,
34900 covariance: [0.0_f32; 9usize],
34901 reset_counter: 0_u8,
34902 };
34903 #[cfg(feature = "arbitrary")]
34904 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34905 use arbitrary::{Arbitrary, Unstructured};
34906 let mut buf = [0u8; 1024];
34907 rng.fill_bytes(&mut buf);
34908 let mut unstructured = Unstructured::new(&buf);
34909 Self::arbitrary(&mut unstructured).unwrap_or_default()
34910 }
34911}
34912impl Default for VISION_SPEED_ESTIMATE_DATA {
34913 fn default() -> Self {
34914 Self::DEFAULT.clone()
34915 }
34916}
34917impl MessageData for VISION_SPEED_ESTIMATE_DATA {
34918 type Message = MavMessage;
34919 const ID: u32 = 103u32;
34920 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
34921 const EXTRA_CRC: u8 = 208u8;
34922 const ENCODED_LEN: usize = 57usize;
34923 fn deser(
34924 _version: MavlinkVersion,
34925 __input: &[u8],
34926 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34927 let avail_len = __input.len();
34928 let mut payload_buf = [0; Self::ENCODED_LEN];
34929 let mut buf = if avail_len < Self::ENCODED_LEN {
34930 payload_buf[0..avail_len].copy_from_slice(__input);
34931 Bytes::new(&payload_buf)
34932 } else {
34933 Bytes::new(__input)
34934 };
34935 let mut __struct = Self::default();
34936 __struct.usec = buf.get_u64_le();
34937 __struct.x = buf.get_f32_le();
34938 __struct.y = buf.get_f32_le();
34939 __struct.z = buf.get_f32_le();
34940 for v in &mut __struct.covariance {
34941 let val = buf.get_f32_le();
34942 *v = val;
34943 }
34944 __struct.reset_counter = buf.get_u8();
34945 Ok(__struct)
34946 }
34947 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34948 let mut __tmp = BytesMut::new(bytes);
34949 #[allow(clippy::absurd_extreme_comparisons)]
34950 #[allow(unused_comparisons)]
34951 if __tmp.remaining() < Self::ENCODED_LEN {
34952 panic!(
34953 "buffer is too small (need {} bytes, but got {})",
34954 Self::ENCODED_LEN,
34955 __tmp.remaining(),
34956 )
34957 }
34958 __tmp.put_u64_le(self.usec);
34959 __tmp.put_f32_le(self.x);
34960 __tmp.put_f32_le(self.y);
34961 __tmp.put_f32_le(self.z);
34962 if matches!(version, MavlinkVersion::V2) {
34963 for val in &self.covariance {
34964 __tmp.put_f32_le(*val);
34965 }
34966 __tmp.put_u8(self.reset_counter);
34967 let len = __tmp.len();
34968 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34969 } else {
34970 __tmp.len()
34971 }
34972 }
34973}
34974#[doc = "Cumulative distance traveled for each reported wheel."]
34975#[doc = ""]
34976#[doc = "ID: 9000"]
34977#[derive(Debug, Clone, PartialEq)]
34978#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34979#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34980#[cfg_attr(feature = "ts", derive(TS))]
34981#[cfg_attr(feature = "ts", ts(export))]
34982pub struct WHEEL_DISTANCE_DATA {
34983 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
34984 pub time_usec: u64,
34985 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
34986 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
34987 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
34988 pub distance: [f64; 16],
34989 #[doc = "Number of wheels reported."]
34990 pub count: u8,
34991}
34992impl WHEEL_DISTANCE_DATA {
34993 pub const ENCODED_LEN: usize = 137usize;
34994 pub const DEFAULT: Self = Self {
34995 time_usec: 0_u64,
34996 distance: [0.0_f64; 16usize],
34997 count: 0_u8,
34998 };
34999 #[cfg(feature = "arbitrary")]
35000 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
35001 use arbitrary::{Arbitrary, Unstructured};
35002 let mut buf = [0u8; 1024];
35003 rng.fill_bytes(&mut buf);
35004 let mut unstructured = Unstructured::new(&buf);
35005 Self::arbitrary(&mut unstructured).unwrap_or_default()
35006 }
35007}
35008impl Default for WHEEL_DISTANCE_DATA {
35009 fn default() -> Self {
35010 Self::DEFAULT.clone()
35011 }
35012}
35013impl MessageData for WHEEL_DISTANCE_DATA {
35014 type Message = MavMessage;
35015 const ID: u32 = 9000u32;
35016 const NAME: &'static str = "WHEEL_DISTANCE";
35017 const EXTRA_CRC: u8 = 113u8;
35018 const ENCODED_LEN: usize = 137usize;
35019 fn deser(
35020 _version: MavlinkVersion,
35021 __input: &[u8],
35022 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35023 let avail_len = __input.len();
35024 let mut payload_buf = [0; Self::ENCODED_LEN];
35025 let mut buf = if avail_len < Self::ENCODED_LEN {
35026 payload_buf[0..avail_len].copy_from_slice(__input);
35027 Bytes::new(&payload_buf)
35028 } else {
35029 Bytes::new(__input)
35030 };
35031 let mut __struct = Self::default();
35032 __struct.time_usec = buf.get_u64_le();
35033 for v in &mut __struct.distance {
35034 let val = buf.get_f64_le();
35035 *v = val;
35036 }
35037 __struct.count = buf.get_u8();
35038 Ok(__struct)
35039 }
35040 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35041 let mut __tmp = BytesMut::new(bytes);
35042 #[allow(clippy::absurd_extreme_comparisons)]
35043 #[allow(unused_comparisons)]
35044 if __tmp.remaining() < Self::ENCODED_LEN {
35045 panic!(
35046 "buffer is too small (need {} bytes, but got {})",
35047 Self::ENCODED_LEN,
35048 __tmp.remaining(),
35049 )
35050 }
35051 __tmp.put_u64_le(self.time_usec);
35052 for val in &self.distance {
35053 __tmp.put_f64_le(*val);
35054 }
35055 __tmp.put_u8(self.count);
35056 if matches!(version, MavlinkVersion::V2) {
35057 let len = __tmp.len();
35058 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
35059 } else {
35060 __tmp.len()
35061 }
35062 }
35063}
35064#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
35065#[doc = ""]
35066#[doc = "ID: 299"]
35067#[derive(Debug, Clone, PartialEq)]
35068#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
35069#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
35070#[cfg_attr(feature = "ts", derive(TS))]
35071#[cfg_attr(feature = "ts", ts(export))]
35072pub struct WIFI_CONFIG_AP_DATA {
35073 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
35074 #[cfg_attr(
35075 feature = "serde",
35076 serde(
35077 serialize_with = "crate::nulstr::serialize::<_, 32>",
35078 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
35079 )
35080 )]
35081 #[cfg_attr(feature = "ts", ts(type = "string"))]
35082 pub ssid: [u8; 32],
35083 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
35084 #[cfg_attr(
35085 feature = "serde",
35086 serde(
35087 serialize_with = "crate::nulstr::serialize::<_, 64>",
35088 deserialize_with = "crate::nulstr::deserialize::<_, 64>"
35089 )
35090 )]
35091 #[cfg_attr(feature = "ts", ts(type = "string"))]
35092 pub password: [u8; 64],
35093 #[doc = "WiFi Mode."]
35094 #[cfg_attr(feature = "serde", serde(default))]
35095 pub mode: WifiConfigApMode,
35096 #[doc = "Message acceptance response (sent back to GS)."]
35097 #[cfg_attr(feature = "serde", serde(default))]
35098 pub response: WifiConfigApResponse,
35099}
35100impl WIFI_CONFIG_AP_DATA {
35101 pub const ENCODED_LEN: usize = 98usize;
35102 pub const DEFAULT: Self = Self {
35103 ssid: [0_u8; 32usize],
35104 password: [0_u8; 64usize],
35105 mode: WifiConfigApMode::DEFAULT,
35106 response: WifiConfigApResponse::DEFAULT,
35107 };
35108 #[cfg(feature = "arbitrary")]
35109 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
35110 use arbitrary::{Arbitrary, Unstructured};
35111 let mut buf = [0u8; 1024];
35112 rng.fill_bytes(&mut buf);
35113 let mut unstructured = Unstructured::new(&buf);
35114 Self::arbitrary(&mut unstructured).unwrap_or_default()
35115 }
35116}
35117impl Default for WIFI_CONFIG_AP_DATA {
35118 fn default() -> Self {
35119 Self::DEFAULT.clone()
35120 }
35121}
35122impl MessageData for WIFI_CONFIG_AP_DATA {
35123 type Message = MavMessage;
35124 const ID: u32 = 299u32;
35125 const NAME: &'static str = "WIFI_CONFIG_AP";
35126 const EXTRA_CRC: u8 = 19u8;
35127 const ENCODED_LEN: usize = 98usize;
35128 fn deser(
35129 _version: MavlinkVersion,
35130 __input: &[u8],
35131 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35132 let avail_len = __input.len();
35133 let mut payload_buf = [0; Self::ENCODED_LEN];
35134 let mut buf = if avail_len < Self::ENCODED_LEN {
35135 payload_buf[0..avail_len].copy_from_slice(__input);
35136 Bytes::new(&payload_buf)
35137 } else {
35138 Bytes::new(__input)
35139 };
35140 let mut __struct = Self::default();
35141 for v in &mut __struct.ssid {
35142 let val = buf.get_u8();
35143 *v = val;
35144 }
35145 for v in &mut __struct.password {
35146 let val = buf.get_u8();
35147 *v = val;
35148 }
35149 let tmp = buf.get_i8();
35150 __struct.mode =
35151 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
35152 enum_type: "WifiConfigApMode",
35153 value: tmp as u32,
35154 })?;
35155 let tmp = buf.get_i8();
35156 __struct.response =
35157 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
35158 enum_type: "WifiConfigApResponse",
35159 value: tmp as u32,
35160 })?;
35161 Ok(__struct)
35162 }
35163 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35164 let mut __tmp = BytesMut::new(bytes);
35165 #[allow(clippy::absurd_extreme_comparisons)]
35166 #[allow(unused_comparisons)]
35167 if __tmp.remaining() < Self::ENCODED_LEN {
35168 panic!(
35169 "buffer is too small (need {} bytes, but got {})",
35170 Self::ENCODED_LEN,
35171 __tmp.remaining(),
35172 )
35173 }
35174 for val in &self.ssid {
35175 __tmp.put_u8(*val);
35176 }
35177 for val in &self.password {
35178 __tmp.put_u8(*val);
35179 }
35180 if matches!(version, MavlinkVersion::V2) {
35181 __tmp.put_i8(self.mode as i8);
35182 __tmp.put_i8(self.response as i8);
35183 let len = __tmp.len();
35184 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
35185 } else {
35186 __tmp.len()
35187 }
35188 }
35189}
35190#[doc = "Winch status."]
35191#[doc = ""]
35192#[doc = "ID: 9005"]
35193#[derive(Debug, Clone, PartialEq)]
35194#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
35195#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
35196#[cfg_attr(feature = "ts", derive(TS))]
35197#[cfg_attr(feature = "ts", ts(export))]
35198pub struct WINCH_STATUS_DATA {
35199 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
35200 pub time_usec: u64,
35201 #[doc = "Length of line released. NaN if unknown"]
35202 pub line_length: f32,
35203 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
35204 pub speed: f32,
35205 #[doc = "Tension on the line. NaN if unknown"]
35206 pub tension: f32,
35207 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
35208 pub voltage: f32,
35209 #[doc = "Current draw from the winch. NaN if unknown"]
35210 pub current: f32,
35211 #[doc = "Status flags"]
35212 pub status: MavWinchStatusFlag,
35213 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
35214 pub temperature: i16,
35215}
35216impl WINCH_STATUS_DATA {
35217 pub const ENCODED_LEN: usize = 34usize;
35218 pub const DEFAULT: Self = Self {
35219 time_usec: 0_u64,
35220 line_length: 0.0_f32,
35221 speed: 0.0_f32,
35222 tension: 0.0_f32,
35223 voltage: 0.0_f32,
35224 current: 0.0_f32,
35225 status: MavWinchStatusFlag::DEFAULT,
35226 temperature: 0_i16,
35227 };
35228 #[cfg(feature = "arbitrary")]
35229 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
35230 use arbitrary::{Arbitrary, Unstructured};
35231 let mut buf = [0u8; 1024];
35232 rng.fill_bytes(&mut buf);
35233 let mut unstructured = Unstructured::new(&buf);
35234 Self::arbitrary(&mut unstructured).unwrap_or_default()
35235 }
35236}
35237impl Default for WINCH_STATUS_DATA {
35238 fn default() -> Self {
35239 Self::DEFAULT.clone()
35240 }
35241}
35242impl MessageData for WINCH_STATUS_DATA {
35243 type Message = MavMessage;
35244 const ID: u32 = 9005u32;
35245 const NAME: &'static str = "WINCH_STATUS";
35246 const EXTRA_CRC: u8 = 117u8;
35247 const ENCODED_LEN: usize = 34usize;
35248 fn deser(
35249 _version: MavlinkVersion,
35250 __input: &[u8],
35251 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35252 let avail_len = __input.len();
35253 let mut payload_buf = [0; Self::ENCODED_LEN];
35254 let mut buf = if avail_len < Self::ENCODED_LEN {
35255 payload_buf[0..avail_len].copy_from_slice(__input);
35256 Bytes::new(&payload_buf)
35257 } else {
35258 Bytes::new(__input)
35259 };
35260 let mut __struct = Self::default();
35261 __struct.time_usec = buf.get_u64_le();
35262 __struct.line_length = buf.get_f32_le();
35263 __struct.speed = buf.get_f32_le();
35264 __struct.tension = buf.get_f32_le();
35265 __struct.voltage = buf.get_f32_le();
35266 __struct.current = buf.get_f32_le();
35267 let tmp = buf.get_u32_le();
35268 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
35269 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
35270 flag_type: "MavWinchStatusFlag",
35271 value: tmp as u32,
35272 })?;
35273 __struct.temperature = buf.get_i16_le();
35274 Ok(__struct)
35275 }
35276 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35277 let mut __tmp = BytesMut::new(bytes);
35278 #[allow(clippy::absurd_extreme_comparisons)]
35279 #[allow(unused_comparisons)]
35280 if __tmp.remaining() < Self::ENCODED_LEN {
35281 panic!(
35282 "buffer is too small (need {} bytes, but got {})",
35283 Self::ENCODED_LEN,
35284 __tmp.remaining(),
35285 )
35286 }
35287 __tmp.put_u64_le(self.time_usec);
35288 __tmp.put_f32_le(self.line_length);
35289 __tmp.put_f32_le(self.speed);
35290 __tmp.put_f32_le(self.tension);
35291 __tmp.put_f32_le(self.voltage);
35292 __tmp.put_f32_le(self.current);
35293 __tmp.put_u32_le(self.status.bits());
35294 __tmp.put_i16_le(self.temperature);
35295 if matches!(version, MavlinkVersion::V2) {
35296 let len = __tmp.len();
35297 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
35298 } else {
35299 __tmp.len()
35300 }
35301 }
35302}
35303#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
35304#[doc = ""]
35305#[doc = "ID: 231"]
35306#[derive(Debug, Clone, PartialEq)]
35307#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
35308#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
35309#[cfg_attr(feature = "ts", derive(TS))]
35310#[cfg_attr(feature = "ts", ts(export))]
35311pub struct WIND_COV_DATA {
35312 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
35313 pub time_usec: u64,
35314 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
35315 pub wind_x: f32,
35316 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
35317 pub wind_y: f32,
35318 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
35319 pub wind_z: f32,
35320 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
35321 pub var_horiz: f32,
35322 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
35323 pub var_vert: f32,
35324 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
35325 pub wind_alt: f32,
35326 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
35327 pub horiz_accuracy: f32,
35328 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
35329 pub vert_accuracy: f32,
35330}
35331impl WIND_COV_DATA {
35332 pub const ENCODED_LEN: usize = 40usize;
35333 pub const DEFAULT: Self = Self {
35334 time_usec: 0_u64,
35335 wind_x: 0.0_f32,
35336 wind_y: 0.0_f32,
35337 wind_z: 0.0_f32,
35338 var_horiz: 0.0_f32,
35339 var_vert: 0.0_f32,
35340 wind_alt: 0.0_f32,
35341 horiz_accuracy: 0.0_f32,
35342 vert_accuracy: 0.0_f32,
35343 };
35344 #[cfg(feature = "arbitrary")]
35345 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
35346 use arbitrary::{Arbitrary, Unstructured};
35347 let mut buf = [0u8; 1024];
35348 rng.fill_bytes(&mut buf);
35349 let mut unstructured = Unstructured::new(&buf);
35350 Self::arbitrary(&mut unstructured).unwrap_or_default()
35351 }
35352}
35353impl Default for WIND_COV_DATA {
35354 fn default() -> Self {
35355 Self::DEFAULT.clone()
35356 }
35357}
35358impl MessageData for WIND_COV_DATA {
35359 type Message = MavMessage;
35360 const ID: u32 = 231u32;
35361 const NAME: &'static str = "WIND_COV";
35362 const EXTRA_CRC: u8 = 105u8;
35363 const ENCODED_LEN: usize = 40usize;
35364 fn deser(
35365 _version: MavlinkVersion,
35366 __input: &[u8],
35367 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35368 let avail_len = __input.len();
35369 let mut payload_buf = [0; Self::ENCODED_LEN];
35370 let mut buf = if avail_len < Self::ENCODED_LEN {
35371 payload_buf[0..avail_len].copy_from_slice(__input);
35372 Bytes::new(&payload_buf)
35373 } else {
35374 Bytes::new(__input)
35375 };
35376 let mut __struct = Self::default();
35377 __struct.time_usec = buf.get_u64_le();
35378 __struct.wind_x = buf.get_f32_le();
35379 __struct.wind_y = buf.get_f32_le();
35380 __struct.wind_z = buf.get_f32_le();
35381 __struct.var_horiz = buf.get_f32_le();
35382 __struct.var_vert = buf.get_f32_le();
35383 __struct.wind_alt = buf.get_f32_le();
35384 __struct.horiz_accuracy = buf.get_f32_le();
35385 __struct.vert_accuracy = buf.get_f32_le();
35386 Ok(__struct)
35387 }
35388 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35389 let mut __tmp = BytesMut::new(bytes);
35390 #[allow(clippy::absurd_extreme_comparisons)]
35391 #[allow(unused_comparisons)]
35392 if __tmp.remaining() < Self::ENCODED_LEN {
35393 panic!(
35394 "buffer is too small (need {} bytes, but got {})",
35395 Self::ENCODED_LEN,
35396 __tmp.remaining(),
35397 )
35398 }
35399 __tmp.put_u64_le(self.time_usec);
35400 __tmp.put_f32_le(self.wind_x);
35401 __tmp.put_f32_le(self.wind_y);
35402 __tmp.put_f32_le(self.wind_z);
35403 __tmp.put_f32_le(self.var_horiz);
35404 __tmp.put_f32_le(self.var_vert);
35405 __tmp.put_f32_le(self.wind_alt);
35406 __tmp.put_f32_le(self.horiz_accuracy);
35407 __tmp.put_f32_le(self.vert_accuracy);
35408 if matches!(version, MavlinkVersion::V2) {
35409 let len = __tmp.len();
35410 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
35411 } else {
35412 __tmp.len()
35413 }
35414 }
35415}
35416#[derive(Clone, PartialEq, Debug)]
35417#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
35418#[cfg_attr(feature = "serde", serde(tag = "type"))]
35419#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
35420#[cfg_attr(feature = "ts", derive(TS))]
35421#[cfg_attr(feature = "ts", ts(export))]
35422#[repr(u32)]
35423pub enum MavMessage {
35424 #[doc = "Set the vehicle attitude and body angular rates."]
35425 #[doc = ""]
35426 #[doc = "ID: 140"]
35427 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
35428 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
35429 #[doc = ""]
35430 #[doc = "ID: 375"]
35431 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
35432 #[doc = "The location and information of an ADSB vehicle."]
35433 #[doc = ""]
35434 #[doc = "ID: 246"]
35435 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
35436 #[doc = "The airspeed measured by sensors and IMU."]
35437 #[doc = ""]
35438 #[doc = "ID: 182"]
35439 AIRSPEEDS(AIRSPEEDS_DATA),
35440 #[doc = "The location and information of an AIS vessel."]
35441 #[doc = ""]
35442 #[doc = "ID: 301"]
35443 AIS_VESSEL(AIS_VESSEL_DATA),
35444 #[doc = "The current system altitude."]
35445 #[doc = ""]
35446 #[doc = "ID: 141"]
35447 ALTITUDE(ALTITUDE_DATA),
35448 #[doc = "The altitude measured by sensors and IMU."]
35449 #[doc = ""]
35450 #[doc = "ID: 181"]
35451 ALTITUDES(ALTITUDES_DATA),
35452 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
35453 #[doc = ""]
35454 #[doc = "ID: 30"]
35455 ATTITUDE(ATTITUDE_DATA),
35456 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
35457 #[doc = ""]
35458 #[doc = "ID: 31"]
35459 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
35460 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
35461 #[doc = ""]
35462 #[doc = "ID: 61"]
35463 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
35464 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
35465 #[doc = ""]
35466 #[doc = "ID: 83"]
35467 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
35468 #[doc = "Motion capture attitude and position."]
35469 #[doc = ""]
35470 #[doc = "ID: 138"]
35471 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
35472 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
35473 #[doc = ""]
35474 #[doc = "ID: 7"]
35475 AUTH_KEY(AUTH_KEY_DATA),
35476 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
35477 #[doc = ""]
35478 #[doc = "ID: 286"]
35479 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
35480 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
35481 #[doc = ""]
35482 #[doc = "ID: 148"]
35483 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
35484 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
35485 #[doc = ""]
35486 #[doc = "ID: 435"]
35487 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
35488 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
35489 #[doc = ""]
35490 #[doc = "ID: 437"]
35491 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
35492 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
35493 #[doc = ""]
35494 #[doc = "ID: 372"]
35495 BATTERY_INFO(BATTERY_INFO_DATA),
35496 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
35497 #[doc = ""]
35498 #[doc = "ID: 147"]
35499 BATTERY_STATUS(BATTERY_STATUS_DATA),
35500 #[doc = "Report button state change."]
35501 #[doc = ""]
35502 #[doc = "ID: 257"]
35503 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
35504 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
35505 #[doc = ""]
35506 #[doc = "ID: 262"]
35507 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
35508 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
35509 #[doc = ""]
35510 #[doc = "ID: 271"]
35511 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
35512 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
35513 #[doc = ""]
35514 #[doc = "ID: 263"]
35515 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
35516 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
35517 #[doc = ""]
35518 #[doc = "ID: 259"]
35519 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
35520 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
35521 #[doc = ""]
35522 #[doc = "ID: 260"]
35523 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
35524 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
35525 #[doc = ""]
35526 #[doc = "ID: 277"]
35527 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
35528 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
35529 #[doc = ""]
35530 #[doc = "ID: 276"]
35531 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
35532 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
35533 #[doc = ""]
35534 #[doc = "ID: 275"]
35535 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
35536 #[doc = "Camera-IMU triggering and synchronisation message."]
35537 #[doc = ""]
35538 #[doc = "ID: 112"]
35539 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
35540 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
35541 #[doc = ""]
35542 #[doc = "ID: 387"]
35543 CANFD_FRAME(CANFD_FRAME_DATA),
35544 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
35545 #[doc = ""]
35546 #[doc = "ID: 388"]
35547 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
35548 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
35549 #[doc = ""]
35550 #[doc = "ID: 386"]
35551 CAN_FRAME(CAN_FRAME_DATA),
35552 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
35553 #[doc = ""]
35554 #[doc = "ID: 336"]
35555 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
35556 #[doc = "Report current used cellular network status."]
35557 #[doc = ""]
35558 #[doc = "ID: 334"]
35559 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
35560 #[doc = "Request to control this MAV."]
35561 #[doc = ""]
35562 #[doc = "ID: 5"]
35563 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
35564 #[doc = "Accept / deny control of this MAV."]
35565 #[doc = ""]
35566 #[doc = "ID: 6"]
35567 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
35568 #[doc = "Information about a potential collision."]
35569 #[doc = ""]
35570 #[doc = "ID: 247"]
35571 COLLISION(COLLISION_DATA),
35572 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
35573 #[doc = ""]
35574 #[doc = "ID: 77"]
35575 COMMAND_ACK(COMMAND_ACK_DATA),
35576 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
35577 #[doc = ""]
35578 #[doc = "ID: 80"]
35579 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
35580 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
35581 #[doc = ""]
35582 #[doc = "ID: 75"]
35583 COMMAND_INT(COMMAND_INT_DATA),
35584 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
35585 #[doc = ""]
35586 #[doc = "ID: 76"]
35587 COMMAND_LONG(COMMAND_LONG_DATA),
35588 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
35589 #[doc = ""]
35590 #[doc = "ID: 395"]
35591 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
35592 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
35593 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
35594 #[doc = ""]
35595 #[doc = "ID: 396"]
35596 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
35597 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
35598 #[doc = ""]
35599 #[doc = "ID: 397"]
35600 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
35601 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
35602 #[doc = ""]
35603 #[doc = "ID: 146"]
35604 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
35605 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
35606 #[doc = ""]
35607 #[doc = "ID: 411"]
35608 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
35609 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
35610 #[doc = ""]
35611 #[doc = "ID: 436"]
35612 CURRENT_MODE(CURRENT_MODE_DATA),
35613 #[doc = "Data stream status information."]
35614 #[doc = ""]
35615 #[doc = "ID: 67"]
35616 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
35617 DATA_STREAM(DATA_STREAM_DATA),
35618 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
35619 #[doc = ""]
35620 #[doc = "ID: 130"]
35621 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
35622 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
35623 #[doc = ""]
35624 #[doc = "ID: 254"]
35625 DEBUG(DEBUG_DATA),
35626 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
35627 #[doc = ""]
35628 #[doc = "ID: 350"]
35629 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
35630 #[doc = "To debug something using a named 3D vector."]
35631 #[doc = ""]
35632 #[doc = "ID: 250"]
35633 DEBUG_VECT(DEBUG_VECT_DATA),
35634 #[doc = "Distance sensor information for an onboard rangefinder."]
35635 #[doc = ""]
35636 #[doc = "ID: 132"]
35637 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
35638 #[doc = "EFI status output."]
35639 #[doc = ""]
35640 #[doc = "ID: 225"]
35641 EFI_STATUS(EFI_STATUS_DATA),
35642 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
35643 #[doc = ""]
35644 #[doc = "ID: 131"]
35645 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
35646 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
35647 #[doc = ""]
35648 #[doc = "ID: 290"]
35649 ESC_INFO(ESC_INFO_DATA),
35650 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
35651 #[doc = ""]
35652 #[doc = "ID: 291"]
35653 ESC_STATUS(ESC_STATUS_DATA),
35654 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
35655 #[doc = ""]
35656 #[doc = "ID: 230"]
35657 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
35658 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
35659 #[doc = ""]
35660 #[doc = "ID: 410"]
35661 EVENT(EVENT_DATA),
35662 #[doc = "Provides state for additional features."]
35663 #[doc = ""]
35664 #[doc = "ID: 245"]
35665 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
35666 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
35667 #[doc = ""]
35668 #[doc = "ID: 162"]
35669 FENCE_STATUS(FENCE_STATUS_DATA),
35670 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
35671 #[doc = ""]
35672 #[doc = "ID: 110"]
35673 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
35674 #[doc = "Flexifunction type and parameters for component at function index from buffer."]
35675 #[doc = ""]
35676 #[doc = "ID: 152"]
35677 FLEXIFUNCTION_BUFFER_FUNCTION(FLEXIFUNCTION_BUFFER_FUNCTION_DATA),
35678 #[doc = "Flexifunction type and parameters for component at function index from buffer."]
35679 #[doc = ""]
35680 #[doc = "ID: 153"]
35681 FLEXIFUNCTION_BUFFER_FUNCTION_ACK(FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA),
35682 #[doc = "Acknowldge success or failure of a flexifunction command."]
35683 #[doc = ""]
35684 #[doc = "ID: 157"]
35685 FLEXIFUNCTION_COMMAND(FLEXIFUNCTION_COMMAND_DATA),
35686 #[doc = "Acknowldge success or failure of a flexifunction command."]
35687 #[doc = ""]
35688 #[doc = "ID: 158"]
35689 FLEXIFUNCTION_COMMAND_ACK(FLEXIFUNCTION_COMMAND_ACK_DATA),
35690 #[doc = "Acknowldge success or failure of a flexifunction command."]
35691 #[doc = ""]
35692 #[doc = "ID: 155"]
35693 FLEXIFUNCTION_DIRECTORY(FLEXIFUNCTION_DIRECTORY_DATA),
35694 #[doc = "Acknowldge success or failure of a flexifunction command."]
35695 #[doc = ""]
35696 #[doc = "ID: 156"]
35697 FLEXIFUNCTION_DIRECTORY_ACK(FLEXIFUNCTION_DIRECTORY_ACK_DATA),
35698 #[doc = "Request reading of flexifunction data."]
35699 #[doc = ""]
35700 #[doc = "ID: 151"]
35701 FLEXIFUNCTION_READ_REQ(FLEXIFUNCTION_READ_REQ_DATA),
35702 #[doc = "Depreciated but used as a compiler flag. Do not remove."]
35703 #[doc = ""]
35704 #[doc = "ID: 150"]
35705 FLEXIFUNCTION_SET(FLEXIFUNCTION_SET_DATA),
35706 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
35707 #[doc = ""]
35708 #[doc = "ID: 264"]
35709 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
35710 #[doc = "Current motion information from a designated system."]
35711 #[doc = ""]
35712 #[doc = "ID: 144"]
35713 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
35714 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
35715 #[doc = ""]
35716 #[doc = "ID: 371"]
35717 FUEL_STATUS(FUEL_STATUS_DATA),
35718 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
35719 #[doc = ""]
35720 #[doc = "ID: 373"]
35721 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
35722 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
35723 #[doc = ""]
35724 #[doc = "ID: 285"]
35725 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
35726 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
35727 #[doc = ""]
35728 #[doc = "ID: 283"]
35729 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
35730 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
35731 #[doc = ""]
35732 #[doc = "ID: 284"]
35733 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
35734 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
35735 #[doc = ""]
35736 #[doc = "ID: 280"]
35737 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
35738 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
35739 #[doc = ""]
35740 #[doc = "ID: 282"]
35741 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
35742 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
35743 #[doc = ""]
35744 #[doc = "ID: 288"]
35745 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
35746 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
35747 #[doc = ""]
35748 #[doc = "ID: 287"]
35749 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
35750 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
35751 #[doc = ""]
35752 #[doc = "ID: 281"]
35753 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
35754 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
35755 #[doc = ""]
35756 #[doc = "ID: 33"]
35757 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
35758 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
35759 #[doc = ""]
35760 #[doc = "ID: 63"]
35761 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
35762 #[doc = "Global position/attitude estimate from a vision source."]
35763 #[doc = ""]
35764 #[doc = "ID: 101"]
35765 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
35766 #[doc = "Second GPS data."]
35767 #[doc = ""]
35768 #[doc = "ID: 124"]
35769 GPS2_RAW(GPS2_RAW_DATA),
35770 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
35771 #[doc = ""]
35772 #[doc = "ID: 128"]
35773 GPS2_RTK(GPS2_RTK_DATA),
35774 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
35775 #[doc = ""]
35776 #[doc = "ID: 49"]
35777 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
35778 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
35779 #[doc = ""]
35780 #[doc = "ID: 123"]
35781 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
35782 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
35783 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
35784 #[doc = ""]
35785 #[doc = "ID: 232"]
35786 GPS_INPUT(GPS_INPUT_DATA),
35787 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
35788 #[doc = ""]
35789 #[doc = "ID: 24"]
35790 GPS_RAW_INT(GPS_RAW_INT_DATA),
35791 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
35792 #[doc = ""]
35793 #[doc = "ID: 233"]
35794 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
35795 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
35796 #[doc = ""]
35797 #[doc = "ID: 127"]
35798 GPS_RTK(GPS_RTK_DATA),
35799 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
35800 #[doc = ""]
35801 #[doc = "ID: 25"]
35802 GPS_STATUS(GPS_STATUS_DATA),
35803 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
35804 #[doc = ""]
35805 #[doc = "ID: 0"]
35806 HEARTBEAT(HEARTBEAT_DATA),
35807 #[doc = "The IMU readings in SI units in NED body frame."]
35808 #[doc = ""]
35809 #[doc = "ID: 105"]
35810 HIGHRES_IMU(HIGHRES_IMU_DATA),
35811 #[doc = "Message appropriate for high latency connections like Iridium."]
35812 #[doc = ""]
35813 #[doc = "ID: 234"]
35814 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
35815 HIGH_LATENCY(HIGH_LATENCY_DATA),
35816 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
35817 #[doc = ""]
35818 #[doc = "ID: 235"]
35819 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
35820 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
35821 #[doc = ""]
35822 #[doc = "ID: 93"]
35823 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
35824 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
35825 #[doc = ""]
35826 #[doc = "ID: 91"]
35827 HIL_CONTROLS(HIL_CONTROLS_DATA),
35828 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
35829 #[doc = ""]
35830 #[doc = "ID: 113"]
35831 HIL_GPS(HIL_GPS_DATA),
35832 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
35833 #[doc = ""]
35834 #[doc = "ID: 114"]
35835 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
35836 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
35837 #[doc = ""]
35838 #[doc = "ID: 92"]
35839 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
35840 #[doc = "The IMU readings in SI units in NED body frame."]
35841 #[doc = ""]
35842 #[doc = "ID: 107"]
35843 HIL_SENSOR(HIL_SENSOR_DATA),
35844 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
35845 #[doc = ""]
35846 #[doc = "ID: 90"]
35847 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
35848 HIL_STATE(HIL_STATE_DATA),
35849 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
35850 #[doc = ""]
35851 #[doc = "ID: 115"]
35852 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
35853 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
35854 #[doc = ""]
35855 #[doc = "ID: 242"]
35856 HOME_POSITION(HOME_POSITION_DATA),
35857 #[doc = "Temperature and humidity from hygrometer."]
35858 #[doc = ""]
35859 #[doc = "ID: 12920"]
35860 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
35861 #[doc = "Illuminator status."]
35862 #[doc = ""]
35863 #[doc = "ID: 440"]
35864 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
35865 #[doc = "Status of the Iridium SBD link."]
35866 #[doc = ""]
35867 #[doc = "ID: 335"]
35868 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
35869 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
35870 #[doc = ""]
35871 #[doc = "ID: 149"]
35872 LANDING_TARGET(LANDING_TARGET_DATA),
35873 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
35874 #[doc = ""]
35875 #[doc = "ID: 8"]
35876 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
35877 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
35878 #[doc = ""]
35879 #[doc = "ID: 32"]
35880 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
35881 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
35882 #[doc = ""]
35883 #[doc = "ID: 64"]
35884 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
35885 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
35886 #[doc = ""]
35887 #[doc = "ID: 89"]
35888 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
35889 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
35890 #[doc = ""]
35891 #[doc = "ID: 268"]
35892 LOGGING_ACK(LOGGING_ACK_DATA),
35893 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
35894 #[doc = ""]
35895 #[doc = "ID: 266"]
35896 LOGGING_DATA(LOGGING_DATA_DATA),
35897 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
35898 #[doc = ""]
35899 #[doc = "ID: 267"]
35900 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
35901 #[doc = "Reply to LOG_REQUEST_DATA."]
35902 #[doc = ""]
35903 #[doc = "ID: 120"]
35904 LOG_DATA(LOG_DATA_DATA),
35905 #[doc = "Reply to LOG_REQUEST_LIST."]
35906 #[doc = ""]
35907 #[doc = "ID: 118"]
35908 LOG_ENTRY(LOG_ENTRY_DATA),
35909 #[doc = "Erase all logs."]
35910 #[doc = ""]
35911 #[doc = "ID: 121"]
35912 LOG_ERASE(LOG_ERASE_DATA),
35913 #[doc = "Request a chunk of a log."]
35914 #[doc = ""]
35915 #[doc = "ID: 119"]
35916 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
35917 #[doc = "Stop log transfer and resume normal logging."]
35918 #[doc = ""]
35919 #[doc = "ID: 122"]
35920 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
35921 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
35922 #[doc = ""]
35923 #[doc = "ID: 117"]
35924 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
35925 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
35926 #[doc = ""]
35927 #[doc = "ID: 192"]
35928 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
35929 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
35930 #[doc = ""]
35931 #[doc = "ID: 69"]
35932 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
35933 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
35934 #[doc = ""]
35935 #[doc = "ID: 81"]
35936 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
35937 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
35938 #[doc = ""]
35939 #[doc = "ID: 249"]
35940 MEMORY_VECT(MEMORY_VECT_DATA),
35941 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
35942 #[doc = ""]
35943 #[doc = "ID: 244"]
35944 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
35945 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
35946 #[doc = ""]
35947 #[doc = "ID: 47"]
35948 MISSION_ACK(MISSION_ACK_DATA),
35949 #[doc = "Delete all mission items at once."]
35950 #[doc = ""]
35951 #[doc = "ID: 45"]
35952 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
35953 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
35954 #[doc = ""]
35955 #[doc = "ID: 44"]
35956 MISSION_COUNT(MISSION_COUNT_DATA),
35957 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
35958 #[doc = ""]
35959 #[doc = "ID: 42"]
35960 MISSION_CURRENT(MISSION_CURRENT_DATA),
35961 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
35962 #[doc = ""]
35963 #[doc = "ID: 39"]
35964 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
35965 MISSION_ITEM(MISSION_ITEM_DATA),
35966 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
35967 #[doc = ""]
35968 #[doc = "ID: 73"]
35969 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
35970 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
35971 #[doc = ""]
35972 #[doc = "ID: 46"]
35973 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
35974 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
35975 #[doc = ""]
35976 #[doc = "ID: 40"]
35977 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
35978 MISSION_REQUEST(MISSION_REQUEST_DATA),
35979 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
35980 #[doc = ""]
35981 #[doc = "ID: 51"]
35982 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
35983 #[doc = "Request the overall list of mission items from the system/component."]
35984 #[doc = ""]
35985 #[doc = "ID: 43"]
35986 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
35987 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
35988 #[doc = ""]
35989 #[doc = "ID: 37"]
35990 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
35991 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
35992 #[doc = ""]
35993 #[doc = "ID: 41"]
35994 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
35995 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
35996 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
35997 #[doc = ""]
35998 #[doc = "ID: 38"]
35999 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
36000 #[doc = "Orientation of a mount."]
36001 #[doc = ""]
36002 #[doc = "ID: 265"]
36003 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
36004 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
36005 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
36006 #[doc = ""]
36007 #[doc = "ID: 251"]
36008 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
36009 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
36010 #[doc = ""]
36011 #[doc = "ID: 252"]
36012 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
36013 #[doc = "The state of the navigation and position controller."]
36014 #[doc = ""]
36015 #[doc = "ID: 62"]
36016 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
36017 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
36018 #[doc = ""]
36019 #[doc = "ID: 330"]
36020 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
36021 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
36022 #[doc = ""]
36023 #[doc = "ID: 331"]
36024 ODOMETRY(ODOMETRY_DATA),
36025 #[doc = "Hardware status sent by an onboard computer."]
36026 #[doc = ""]
36027 #[doc = "ID: 390"]
36028 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
36029 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
36030 #[doc = ""]
36031 #[doc = "ID: 12918"]
36032 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
36033 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
36034 #[doc = ""]
36035 #[doc = "ID: 12902"]
36036 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
36037 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
36038 #[doc = ""]
36039 #[doc = "ID: 12900"]
36040 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
36041 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
36042 #[doc = ""]
36043 #[doc = "ID: 12901"]
36044 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
36045 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
36046 #[doc = ""]
36047 #[doc = "ID: 12915"]
36048 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
36049 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
36050 #[doc = ""]
36051 #[doc = "ID: 12905"]
36052 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
36053 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
36054 #[doc = ""]
36055 #[doc = "ID: 12903"]
36056 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
36057 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
36058 #[doc = ""]
36059 #[doc = "ID: 12904"]
36060 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
36061 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
36062 #[doc = ""]
36063 #[doc = "ID: 12919"]
36064 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
36065 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
36066 #[doc = ""]
36067 #[doc = "ID: 100"]
36068 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
36069 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
36070 #[doc = ""]
36071 #[doc = "ID: 106"]
36072 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
36073 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
36074 #[doc = ""]
36075 #[doc = "ID: 360"]
36076 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
36077 #[doc = "Response from a PARAM_EXT_SET message."]
36078 #[doc = ""]
36079 #[doc = "ID: 324"]
36080 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
36081 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
36082 #[doc = ""]
36083 #[doc = "ID: 321"]
36084 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
36085 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
36086 #[doc = ""]
36087 #[doc = "ID: 320"]
36088 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
36089 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
36090 #[doc = ""]
36091 #[doc = "ID: 323"]
36092 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
36093 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
36094 #[doc = ""]
36095 #[doc = "ID: 322"]
36096 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
36097 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
36098 #[doc = ""]
36099 #[doc = "ID: 50"]
36100 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
36101 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
36102 #[doc = ""]
36103 #[doc = "ID: 21"]
36104 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
36105 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
36106 #[doc = ""]
36107 #[doc = "ID: 20"]
36108 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
36109 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
36110 #[doc = ""]
36111 #[doc = "ID: 23"]
36112 PARAM_SET(PARAM_SET_DATA),
36113 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
36114 #[doc = ""]
36115 #[doc = "ID: 22"]
36116 PARAM_VALUE(PARAM_VALUE_DATA),
36117 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
36118 #[doc = ""]
36119 #[doc = "ID: 4"]
36120 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
36121 PING(PING_DATA),
36122 #[doc = "Control vehicle tone generation (buzzer)."]
36123 #[doc = ""]
36124 #[doc = "ID: 258"]
36125 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
36126 PLAY_TUNE(PLAY_TUNE_DATA),
36127 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
36128 #[doc = ""]
36129 #[doc = "ID: 400"]
36130 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
36131 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
36132 #[doc = ""]
36133 #[doc = "ID: 87"]
36134 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
36135 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
36136 #[doc = ""]
36137 #[doc = "ID: 85"]
36138 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
36139 #[doc = "Power supply status."]
36140 #[doc = ""]
36141 #[doc = "ID: 125"]
36142 POWER_STATUS(POWER_STATUS_DATA),
36143 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
36144 #[doc = ""]
36145 #[doc = "ID: 300"]
36146 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
36147 #[doc = "Status generated by radio and injected into MAVLink stream."]
36148 #[doc = ""]
36149 #[doc = "ID: 109"]
36150 RADIO_STATUS(RADIO_STATUS_DATA),
36151 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
36152 #[doc = ""]
36153 #[doc = "ID: 27"]
36154 RAW_IMU(RAW_IMU_DATA),
36155 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
36156 #[doc = ""]
36157 #[doc = "ID: 28"]
36158 RAW_PRESSURE(RAW_PRESSURE_DATA),
36159 #[doc = "RPM sensor data message."]
36160 #[doc = ""]
36161 #[doc = "ID: 339"]
36162 RAW_RPM(RAW_RPM_DATA),
36163 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
36164 #[doc = ""]
36165 #[doc = "ID: 65"]
36166 RC_CHANNELS(RC_CHANNELS_DATA),
36167 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
36168 #[doc = ""]
36169 #[doc = "ID: 70"]
36170 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
36171 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
36172 #[doc = ""]
36173 #[doc = "ID: 35"]
36174 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
36175 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
36176 #[doc = ""]
36177 #[doc = "ID: 34"]
36178 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
36179 #[doc = "Request a data stream."]
36180 #[doc = ""]
36181 #[doc = "ID: 66"]
36182 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
36183 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
36184 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
36185 #[doc = ""]
36186 #[doc = "ID: 412"]
36187 REQUEST_EVENT(REQUEST_EVENT_DATA),
36188 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
36189 #[doc = ""]
36190 #[doc = "ID: 142"]
36191 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
36192 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
36193 #[doc = ""]
36194 #[doc = "ID: 413"]
36195 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
36196 #[doc = "Read out the safety zone the MAV currently assumes."]
36197 #[doc = ""]
36198 #[doc = "ID: 55"]
36199 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
36200 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
36201 #[doc = ""]
36202 #[doc = "ID: 54"]
36203 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
36204 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
36205 #[doc = ""]
36206 #[doc = "ID: 26"]
36207 SCALED_IMU(SCALED_IMU_DATA),
36208 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
36209 #[doc = ""]
36210 #[doc = "ID: 116"]
36211 SCALED_IMU2(SCALED_IMU2_DATA),
36212 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
36213 #[doc = ""]
36214 #[doc = "ID: 129"]
36215 SCALED_IMU3(SCALED_IMU3_DATA),
36216 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
36217 #[doc = ""]
36218 #[doc = "ID: 29"]
36219 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
36220 #[doc = "Barometer readings for 2nd barometer."]
36221 #[doc = ""]
36222 #[doc = "ID: 137"]
36223 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
36224 #[doc = "Barometer readings for 3rd barometer."]
36225 #[doc = ""]
36226 #[doc = "ID: 143"]
36227 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
36228 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
36229 #[doc = ""]
36230 #[doc = "ID: 126"]
36231 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
36232 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F13: format."]
36233 #[doc = ""]
36234 #[doc = "ID: 177"]
36235 SERIAL_UDB_EXTRA_F13(SERIAL_UDB_EXTRA_F13_DATA),
36236 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F14: format."]
36237 #[doc = ""]
36238 #[doc = "ID: 178"]
36239 SERIAL_UDB_EXTRA_F14(SERIAL_UDB_EXTRA_F14_DATA),
36240 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F15 format."]
36241 #[doc = ""]
36242 #[doc = "ID: 179"]
36243 SERIAL_UDB_EXTRA_F15(SERIAL_UDB_EXTRA_F15_DATA),
36244 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F16 format."]
36245 #[doc = ""]
36246 #[doc = "ID: 180"]
36247 SERIAL_UDB_EXTRA_F16(SERIAL_UDB_EXTRA_F16_DATA),
36248 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F17 format."]
36249 #[doc = ""]
36250 #[doc = "ID: 183"]
36251 SERIAL_UDB_EXTRA_F17(SERIAL_UDB_EXTRA_F17_DATA),
36252 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F18 format."]
36253 #[doc = ""]
36254 #[doc = "ID: 184"]
36255 SERIAL_UDB_EXTRA_F18(SERIAL_UDB_EXTRA_F18_DATA),
36256 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F19 format."]
36257 #[doc = ""]
36258 #[doc = "ID: 185"]
36259 SERIAL_UDB_EXTRA_F19(SERIAL_UDB_EXTRA_F19_DATA),
36260 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F20 format."]
36261 #[doc = ""]
36262 #[doc = "ID: 186"]
36263 SERIAL_UDB_EXTRA_F20(SERIAL_UDB_EXTRA_F20_DATA),
36264 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F21 format."]
36265 #[doc = ""]
36266 #[doc = "ID: 187"]
36267 SERIAL_UDB_EXTRA_F21(SERIAL_UDB_EXTRA_F21_DATA),
36268 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F22 format."]
36269 #[doc = ""]
36270 #[doc = "ID: 188"]
36271 SERIAL_UDB_EXTRA_F22(SERIAL_UDB_EXTRA_F22_DATA),
36272 #[doc = "Backwards compatible MAVLink version of SERIAL_UDB_EXTRA - F2: Format Part A."]
36273 #[doc = ""]
36274 #[doc = "ID: 170"]
36275 SERIAL_UDB_EXTRA_F2_A(SERIAL_UDB_EXTRA_F2_A_DATA),
36276 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA - F2: Part B."]
36277 #[doc = ""]
36278 #[doc = "ID: 171"]
36279 SERIAL_UDB_EXTRA_F2_B(SERIAL_UDB_EXTRA_F2_B_DATA),
36280 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F4: format."]
36281 #[doc = ""]
36282 #[doc = "ID: 172"]
36283 SERIAL_UDB_EXTRA_F4(SERIAL_UDB_EXTRA_F4_DATA),
36284 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F5: format."]
36285 #[doc = ""]
36286 #[doc = "ID: 173"]
36287 SERIAL_UDB_EXTRA_F5(SERIAL_UDB_EXTRA_F5_DATA),
36288 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F6: format."]
36289 #[doc = ""]
36290 #[doc = "ID: 174"]
36291 SERIAL_UDB_EXTRA_F6(SERIAL_UDB_EXTRA_F6_DATA),
36292 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F7: format."]
36293 #[doc = ""]
36294 #[doc = "ID: 175"]
36295 SERIAL_UDB_EXTRA_F7(SERIAL_UDB_EXTRA_F7_DATA),
36296 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F8: format."]
36297 #[doc = ""]
36298 #[doc = "ID: 176"]
36299 SERIAL_UDB_EXTRA_F8(SERIAL_UDB_EXTRA_F8_DATA),
36300 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
36301 #[doc = ""]
36302 #[doc = "ID: 36"]
36303 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
36304 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
36305 #[doc = ""]
36306 #[doc = "ID: 256"]
36307 SETUP_SIGNING(SETUP_SIGNING_DATA),
36308 #[doc = "Set the vehicle attitude and body angular rates."]
36309 #[doc = ""]
36310 #[doc = "ID: 139"]
36311 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
36312 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
36313 #[doc = ""]
36314 #[doc = "ID: 82"]
36315 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
36316 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
36317 #[doc = ""]
36318 #[doc = "ID: 48"]
36319 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
36320 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
36321 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
36322 #[doc = ""]
36323 #[doc = "ID: 243"]
36324 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
36325 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
36326 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
36327 #[doc = ""]
36328 #[doc = "ID: 11"]
36329 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
36330 SET_MODE(SET_MODE_DATA),
36331 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
36332 #[doc = ""]
36333 #[doc = "ID: 86"]
36334 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
36335 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
36336 #[doc = ""]
36337 #[doc = "ID: 84"]
36338 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
36339 #[doc = "Status of simulation environment, if used."]
36340 #[doc = ""]
36341 #[doc = "ID: 108"]
36342 SIM_STATE(SIM_STATE_DATA),
36343 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
36344 #[doc = ""]
36345 #[doc = "ID: 370"]
36346 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
36347 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
36348 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
36349 #[doc = ""]
36350 #[doc = "ID: 253"]
36351 STATUSTEXT(STATUSTEXT_DATA),
36352 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
36353 #[doc = ""]
36354 #[doc = "ID: 261"]
36355 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
36356 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
36357 #[doc = ""]
36358 #[doc = "ID: 401"]
36359 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
36360 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
36361 #[doc = ""]
36362 #[doc = "ID: 2"]
36363 SYSTEM_TIME(SYSTEM_TIME_DATA),
36364 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
36365 #[doc = ""]
36366 #[doc = "ID: 1"]
36367 SYS_STATUS(SYS_STATUS_DATA),
36368 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
36369 #[doc = ""]
36370 #[doc = "ID: 135"]
36371 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
36372 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
36373 #[doc = ""]
36374 #[doc = "ID: 134"]
36375 TERRAIN_DATA(TERRAIN_DATA_DATA),
36376 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
36377 #[doc = ""]
36378 #[doc = "ID: 136"]
36379 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
36380 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
36381 #[doc = ""]
36382 #[doc = "ID: 133"]
36383 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
36384 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
36385 #[doc = ""]
36386 #[doc = "ID: 111"]
36387 TIMESYNC(TIMESYNC_DATA),
36388 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
36389 #[doc = ""]
36390 #[doc = "ID: 380"]
36391 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
36392 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
36393 #[doc = ""]
36394 #[doc = "ID: 333"]
36395 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
36396 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
36397 #[doc = ""]
36398 #[doc = "ID: 332"]
36399 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
36400 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
36401 #[doc = ""]
36402 #[doc = "ID: 385"]
36403 TUNNEL(TUNNEL_DATA),
36404 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
36405 #[doc = ""]
36406 #[doc = "ID: 311"]
36407 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
36408 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
36409 #[doc = ""]
36410 #[doc = "ID: 310"]
36411 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
36412 #[doc = "The global position resulting from GPS and sensor fusion."]
36413 #[doc = ""]
36414 #[doc = "ID: 340"]
36415 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
36416 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
36417 #[doc = ""]
36418 #[doc = "ID: 248"]
36419 V2_EXTENSION(V2_EXTENSION_DATA),
36420 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
36421 #[doc = ""]
36422 #[doc = "ID: 74"]
36423 VFR_HUD(VFR_HUD_DATA),
36424 #[doc = "Vibration levels and accelerometer clipping."]
36425 #[doc = ""]
36426 #[doc = "ID: 241"]
36427 VIBRATION(VIBRATION_DATA),
36428 #[doc = "Global position estimate from a Vicon motion system source."]
36429 #[doc = ""]
36430 #[doc = "ID: 104"]
36431 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
36432 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
36433 #[doc = ""]
36434 #[doc = "ID: 269"]
36435 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
36436 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
36437 #[doc = ""]
36438 #[doc = "ID: 270"]
36439 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
36440 #[doc = "Local position/attitude estimate from a vision source."]
36441 #[doc = ""]
36442 #[doc = "ID: 102"]
36443 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
36444 #[doc = "Speed estimate from a vision source."]
36445 #[doc = ""]
36446 #[doc = "ID: 103"]
36447 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
36448 #[doc = "Cumulative distance traveled for each reported wheel."]
36449 #[doc = ""]
36450 #[doc = "ID: 9000"]
36451 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
36452 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
36453 #[doc = ""]
36454 #[doc = "ID: 299"]
36455 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
36456 #[doc = "Winch status."]
36457 #[doc = ""]
36458 #[doc = "ID: 9005"]
36459 WINCH_STATUS(WINCH_STATUS_DATA),
36460 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
36461 #[doc = ""]
36462 #[doc = "ID: 231"]
36463 WIND_COV(WIND_COV_DATA),
36464}
36465impl MavMessage {
36466 pub const fn all_ids() -> &'static [u32] {
36467 &[
36468 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
36469 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
36470 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
36471 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
36472 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
36473 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
36474 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
36475 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
36476 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
36477 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
36478 148u32, 149u32, 150u32, 151u32, 152u32, 153u32, 155u32, 156u32, 157u32, 158u32, 162u32,
36479 170u32, 171u32, 172u32, 173u32, 174u32, 175u32, 176u32, 177u32, 178u32, 179u32, 180u32,
36480 181u32, 182u32, 183u32, 184u32, 185u32, 186u32, 187u32, 188u32, 192u32, 225u32, 230u32,
36481 231u32, 232u32, 233u32, 234u32, 235u32, 241u32, 242u32, 243u32, 244u32, 245u32, 246u32,
36482 247u32, 248u32, 249u32, 250u32, 251u32, 252u32, 253u32, 254u32, 256u32, 257u32, 258u32,
36483 259u32, 260u32, 261u32, 262u32, 263u32, 264u32, 265u32, 266u32, 267u32, 268u32, 269u32,
36484 270u32, 271u32, 275u32, 276u32, 277u32, 280u32, 281u32, 282u32, 283u32, 284u32, 285u32,
36485 286u32, 287u32, 288u32, 290u32, 291u32, 299u32, 300u32, 301u32, 310u32, 311u32, 320u32,
36486 321u32, 322u32, 323u32, 324u32, 330u32, 331u32, 332u32, 333u32, 334u32, 335u32, 336u32,
36487 339u32, 340u32, 350u32, 360u32, 370u32, 371u32, 372u32, 373u32, 375u32, 380u32, 385u32,
36488 386u32, 387u32, 388u32, 390u32, 395u32, 396u32, 397u32, 400u32, 401u32, 410u32, 411u32,
36489 412u32, 413u32, 435u32, 436u32, 437u32, 440u32, 9000u32, 9005u32, 12900u32, 12901u32,
36490 12902u32, 12903u32, 12904u32, 12905u32, 12915u32, 12918u32, 12919u32, 12920u32,
36491 ]
36492 }
36493}
36494impl Message for MavMessage {
36495 fn parse(
36496 version: MavlinkVersion,
36497 id: u32,
36498 payload: &[u8],
36499 ) -> Result<Self, ::mavlink_core::error::ParserError> {
36500 match id {
36501 ACTUATOR_CONTROL_TARGET_DATA::ID => {
36502 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
36503 .map(Self::ACTUATOR_CONTROL_TARGET)
36504 }
36505 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
36506 .map(Self::ACTUATOR_OUTPUT_STATUS),
36507 ADSB_VEHICLE_DATA::ID => {
36508 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
36509 }
36510 AIRSPEEDS_DATA::ID => AIRSPEEDS_DATA::deser(version, payload).map(Self::AIRSPEEDS),
36511 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
36512 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
36513 ALTITUDES_DATA::ID => ALTITUDES_DATA::deser(version, payload).map(Self::ALTITUDES),
36514 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
36515 ATTITUDE_QUATERNION_DATA::ID => {
36516 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
36517 }
36518 ATTITUDE_QUATERNION_COV_DATA::ID => {
36519 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
36520 .map(Self::ATTITUDE_QUATERNION_COV)
36521 }
36522 ATTITUDE_TARGET_DATA::ID => {
36523 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
36524 }
36525 ATT_POS_MOCAP_DATA::ID => {
36526 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
36527 }
36528 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
36529 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36530 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
36531 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
36532 }
36533 AUTOPILOT_VERSION_DATA::ID => {
36534 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
36535 }
36536 AVAILABLE_MODES_DATA::ID => {
36537 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
36538 }
36539 AVAILABLE_MODES_MONITOR_DATA::ID => {
36540 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
36541 .map(Self::AVAILABLE_MODES_MONITOR)
36542 }
36543 BATTERY_INFO_DATA::ID => {
36544 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
36545 }
36546 BATTERY_STATUS_DATA::ID => {
36547 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
36548 }
36549 BUTTON_CHANGE_DATA::ID => {
36550 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
36551 }
36552 CAMERA_CAPTURE_STATUS_DATA::ID => {
36553 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
36554 }
36555 CAMERA_FOV_STATUS_DATA::ID => {
36556 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
36557 }
36558 CAMERA_IMAGE_CAPTURED_DATA::ID => {
36559 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
36560 }
36561 CAMERA_INFORMATION_DATA::ID => {
36562 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
36563 }
36564 CAMERA_SETTINGS_DATA::ID => {
36565 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
36566 }
36567 CAMERA_THERMAL_RANGE_DATA::ID => {
36568 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
36569 }
36570 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
36571 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
36572 .map(Self::CAMERA_TRACKING_GEO_STATUS)
36573 }
36574 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
36575 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
36576 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
36577 }
36578 CAMERA_TRIGGER_DATA::ID => {
36579 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
36580 }
36581 CANFD_FRAME_DATA::ID => {
36582 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
36583 }
36584 CAN_FILTER_MODIFY_DATA::ID => {
36585 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
36586 }
36587 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
36588 CELLULAR_CONFIG_DATA::ID => {
36589 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
36590 }
36591 CELLULAR_STATUS_DATA::ID => {
36592 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
36593 }
36594 CHANGE_OPERATOR_CONTROL_DATA::ID => {
36595 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
36596 .map(Self::CHANGE_OPERATOR_CONTROL)
36597 }
36598 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
36599 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
36600 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
36601 }
36602 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
36603 COMMAND_ACK_DATA::ID => {
36604 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
36605 }
36606 COMMAND_CANCEL_DATA::ID => {
36607 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
36608 }
36609 COMMAND_INT_DATA::ID => {
36610 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
36611 }
36612 COMMAND_LONG_DATA::ID => {
36613 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
36614 }
36615 COMPONENT_INFORMATION_DATA::ID => {
36616 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
36617 }
36618 COMPONENT_INFORMATION_BASIC_DATA::ID => {
36619 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
36620 .map(Self::COMPONENT_INFORMATION_BASIC)
36621 }
36622 COMPONENT_METADATA_DATA::ID => {
36623 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
36624 }
36625 CONTROL_SYSTEM_STATE_DATA::ID => {
36626 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
36627 }
36628 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
36629 .map(Self::CURRENT_EVENT_SEQUENCE),
36630 CURRENT_MODE_DATA::ID => {
36631 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
36632 }
36633 DATA_STREAM_DATA::ID => {
36634 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
36635 }
36636 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
36637 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
36638 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
36639 }
36640 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
36641 DEBUG_FLOAT_ARRAY_DATA::ID => {
36642 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
36643 }
36644 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
36645 DISTANCE_SENSOR_DATA::ID => {
36646 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
36647 }
36648 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
36649 ENCAPSULATED_DATA_DATA::ID => {
36650 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
36651 }
36652 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
36653 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
36654 ESTIMATOR_STATUS_DATA::ID => {
36655 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
36656 }
36657 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
36658 EXTENDED_SYS_STATE_DATA::ID => {
36659 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
36660 }
36661 FENCE_STATUS_DATA::ID => {
36662 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
36663 }
36664 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
36665 .map(Self::FILE_TRANSFER_PROTOCOL),
36666 FLEXIFUNCTION_BUFFER_FUNCTION_DATA::ID => {
36667 FLEXIFUNCTION_BUFFER_FUNCTION_DATA::deser(version, payload)
36668 .map(Self::FLEXIFUNCTION_BUFFER_FUNCTION)
36669 }
36670 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::ID => {
36671 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::deser(version, payload)
36672 .map(Self::FLEXIFUNCTION_BUFFER_FUNCTION_ACK)
36673 }
36674 FLEXIFUNCTION_COMMAND_DATA::ID => {
36675 FLEXIFUNCTION_COMMAND_DATA::deser(version, payload).map(Self::FLEXIFUNCTION_COMMAND)
36676 }
36677 FLEXIFUNCTION_COMMAND_ACK_DATA::ID => {
36678 FLEXIFUNCTION_COMMAND_ACK_DATA::deser(version, payload)
36679 .map(Self::FLEXIFUNCTION_COMMAND_ACK)
36680 }
36681 FLEXIFUNCTION_DIRECTORY_DATA::ID => {
36682 FLEXIFUNCTION_DIRECTORY_DATA::deser(version, payload)
36683 .map(Self::FLEXIFUNCTION_DIRECTORY)
36684 }
36685 FLEXIFUNCTION_DIRECTORY_ACK_DATA::ID => {
36686 FLEXIFUNCTION_DIRECTORY_ACK_DATA::deser(version, payload)
36687 .map(Self::FLEXIFUNCTION_DIRECTORY_ACK)
36688 }
36689 FLEXIFUNCTION_READ_REQ_DATA::ID => FLEXIFUNCTION_READ_REQ_DATA::deser(version, payload)
36690 .map(Self::FLEXIFUNCTION_READ_REQ),
36691 FLEXIFUNCTION_SET_DATA::ID => {
36692 FLEXIFUNCTION_SET_DATA::deser(version, payload).map(Self::FLEXIFUNCTION_SET)
36693 }
36694 FLIGHT_INFORMATION_DATA::ID => {
36695 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
36696 }
36697 FOLLOW_TARGET_DATA::ID => {
36698 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
36699 }
36700 FUEL_STATUS_DATA::ID => {
36701 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
36702 }
36703 GENERATOR_STATUS_DATA::ID => {
36704 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
36705 }
36706 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
36707 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
36708 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
36709 }
36710 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
36711 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
36712 .map(Self::GIMBAL_DEVICE_INFORMATION)
36713 }
36714 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
36715 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
36716 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
36717 }
36718 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
36719 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
36720 .map(Self::GIMBAL_MANAGER_INFORMATION)
36721 }
36722 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
36723 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
36724 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
36725 }
36726 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36727 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
36728 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
36729 }
36730 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
36731 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
36732 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
36733 }
36734 GIMBAL_MANAGER_STATUS_DATA::ID => {
36735 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
36736 }
36737 GLOBAL_POSITION_INT_DATA::ID => {
36738 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
36739 }
36740 GLOBAL_POSITION_INT_COV_DATA::ID => {
36741 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
36742 .map(Self::GLOBAL_POSITION_INT_COV)
36743 }
36744 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36745 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
36746 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
36747 }
36748 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
36749 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
36750 GPS_GLOBAL_ORIGIN_DATA::ID => {
36751 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
36752 }
36753 GPS_INJECT_DATA_DATA::ID => {
36754 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
36755 }
36756 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
36757 GPS_RAW_INT_DATA::ID => {
36758 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
36759 }
36760 GPS_RTCM_DATA_DATA::ID => {
36761 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
36762 }
36763 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
36764 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
36765 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
36766 HIGHRES_IMU_DATA::ID => {
36767 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
36768 }
36769 HIGH_LATENCY_DATA::ID => {
36770 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
36771 }
36772 HIGH_LATENCY2_DATA::ID => {
36773 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
36774 }
36775 HIL_ACTUATOR_CONTROLS_DATA::ID => {
36776 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
36777 }
36778 HIL_CONTROLS_DATA::ID => {
36779 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
36780 }
36781 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
36782 HIL_OPTICAL_FLOW_DATA::ID => {
36783 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
36784 }
36785 HIL_RC_INPUTS_RAW_DATA::ID => {
36786 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
36787 }
36788 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
36789 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
36790 HIL_STATE_QUATERNION_DATA::ID => {
36791 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
36792 }
36793 HOME_POSITION_DATA::ID => {
36794 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
36795 }
36796 HYGROMETER_SENSOR_DATA::ID => {
36797 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
36798 }
36799 ILLUMINATOR_STATUS_DATA::ID => {
36800 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
36801 }
36802 ISBD_LINK_STATUS_DATA::ID => {
36803 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
36804 }
36805 LANDING_TARGET_DATA::ID => {
36806 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
36807 }
36808 LINK_NODE_STATUS_DATA::ID => {
36809 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
36810 }
36811 LOCAL_POSITION_NED_DATA::ID => {
36812 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
36813 }
36814 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
36815 .map(Self::LOCAL_POSITION_NED_COV),
36816 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36817 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
36818 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
36819 }
36820 LOGGING_ACK_DATA::ID => {
36821 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
36822 }
36823 LOGGING_DATA_DATA::ID => {
36824 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
36825 }
36826 LOGGING_DATA_ACKED_DATA::ID => {
36827 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
36828 }
36829 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
36830 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
36831 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
36832 LOG_REQUEST_DATA_DATA::ID => {
36833 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
36834 }
36835 LOG_REQUEST_END_DATA::ID => {
36836 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
36837 }
36838 LOG_REQUEST_LIST_DATA::ID => {
36839 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
36840 }
36841 MAG_CAL_REPORT_DATA::ID => {
36842 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
36843 }
36844 MANUAL_CONTROL_DATA::ID => {
36845 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
36846 }
36847 MANUAL_SETPOINT_DATA::ID => {
36848 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
36849 }
36850 MEMORY_VECT_DATA::ID => {
36851 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
36852 }
36853 MESSAGE_INTERVAL_DATA::ID => {
36854 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
36855 }
36856 MISSION_ACK_DATA::ID => {
36857 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
36858 }
36859 MISSION_CLEAR_ALL_DATA::ID => {
36860 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
36861 }
36862 MISSION_COUNT_DATA::ID => {
36863 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
36864 }
36865 MISSION_CURRENT_DATA::ID => {
36866 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
36867 }
36868 MISSION_ITEM_DATA::ID => {
36869 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
36870 }
36871 MISSION_ITEM_INT_DATA::ID => {
36872 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
36873 }
36874 MISSION_ITEM_REACHED_DATA::ID => {
36875 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
36876 }
36877 MISSION_REQUEST_DATA::ID => {
36878 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
36879 }
36880 MISSION_REQUEST_INT_DATA::ID => {
36881 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
36882 }
36883 MISSION_REQUEST_LIST_DATA::ID => {
36884 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
36885 }
36886 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
36887 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
36888 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
36889 }
36890 MISSION_SET_CURRENT_DATA::ID => {
36891 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
36892 }
36893 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
36894 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
36895 .map(Self::MISSION_WRITE_PARTIAL_LIST)
36896 }
36897 MOUNT_ORIENTATION_DATA::ID => {
36898 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
36899 }
36900 NAMED_VALUE_FLOAT_DATA::ID => {
36901 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
36902 }
36903 NAMED_VALUE_INT_DATA::ID => {
36904 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
36905 }
36906 NAV_CONTROLLER_OUTPUT_DATA::ID => {
36907 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
36908 }
36909 OBSTACLE_DISTANCE_DATA::ID => {
36910 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
36911 }
36912 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
36913 ONBOARD_COMPUTER_STATUS_DATA::ID => {
36914 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
36915 .map(Self::ONBOARD_COMPUTER_STATUS)
36916 }
36917 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
36918 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
36919 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
36920 }
36921 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
36922 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
36923 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
36924 }
36925 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
36926 .map(Self::OPEN_DRONE_ID_BASIC_ID),
36927 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
36928 .map(Self::OPEN_DRONE_ID_LOCATION),
36929 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
36930 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
36931 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
36932 }
36933 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
36934 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
36935 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
36936 }
36937 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
36938 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
36939 }
36940 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
36941 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
36942 }
36943 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
36944 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
36945 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
36946 }
36947 OPTICAL_FLOW_DATA::ID => {
36948 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
36949 }
36950 OPTICAL_FLOW_RAD_DATA::ID => {
36951 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
36952 }
36953 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
36954 .map(Self::ORBIT_EXECUTION_STATUS),
36955 PARAM_EXT_ACK_DATA::ID => {
36956 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
36957 }
36958 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
36959 .map(Self::PARAM_EXT_REQUEST_LIST),
36960 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
36961 .map(Self::PARAM_EXT_REQUEST_READ),
36962 PARAM_EXT_SET_DATA::ID => {
36963 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
36964 }
36965 PARAM_EXT_VALUE_DATA::ID => {
36966 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
36967 }
36968 PARAM_MAP_RC_DATA::ID => {
36969 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
36970 }
36971 PARAM_REQUEST_LIST_DATA::ID => {
36972 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
36973 }
36974 PARAM_REQUEST_READ_DATA::ID => {
36975 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
36976 }
36977 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
36978 PARAM_VALUE_DATA::ID => {
36979 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
36980 }
36981 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
36982 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
36983 PLAY_TUNE_V2_DATA::ID => {
36984 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
36985 }
36986 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
36987 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
36988 .map(Self::POSITION_TARGET_GLOBAL_INT)
36989 }
36990 POSITION_TARGET_LOCAL_NED_DATA::ID => {
36991 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
36992 .map(Self::POSITION_TARGET_LOCAL_NED)
36993 }
36994 POWER_STATUS_DATA::ID => {
36995 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
36996 }
36997 PROTOCOL_VERSION_DATA::ID => {
36998 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
36999 }
37000 RADIO_STATUS_DATA::ID => {
37001 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
37002 }
37003 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
37004 RAW_PRESSURE_DATA::ID => {
37005 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
37006 }
37007 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
37008 RC_CHANNELS_DATA::ID => {
37009 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
37010 }
37011 RC_CHANNELS_OVERRIDE_DATA::ID => {
37012 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
37013 }
37014 RC_CHANNELS_RAW_DATA::ID => {
37015 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
37016 }
37017 RC_CHANNELS_SCALED_DATA::ID => {
37018 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
37019 }
37020 REQUEST_DATA_STREAM_DATA::ID => {
37021 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
37022 }
37023 REQUEST_EVENT_DATA::ID => {
37024 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
37025 }
37026 RESOURCE_REQUEST_DATA::ID => {
37027 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
37028 }
37029 RESPONSE_EVENT_ERROR_DATA::ID => {
37030 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
37031 }
37032 SAFETY_ALLOWED_AREA_DATA::ID => {
37033 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
37034 }
37035 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
37036 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
37037 .map(Self::SAFETY_SET_ALLOWED_AREA)
37038 }
37039 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
37040 SCALED_IMU2_DATA::ID => {
37041 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
37042 }
37043 SCALED_IMU3_DATA::ID => {
37044 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
37045 }
37046 SCALED_PRESSURE_DATA::ID => {
37047 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
37048 }
37049 SCALED_PRESSURE2_DATA::ID => {
37050 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
37051 }
37052 SCALED_PRESSURE3_DATA::ID => {
37053 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
37054 }
37055 SERIAL_CONTROL_DATA::ID => {
37056 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
37057 }
37058 SERIAL_UDB_EXTRA_F13_DATA::ID => {
37059 SERIAL_UDB_EXTRA_F13_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F13)
37060 }
37061 SERIAL_UDB_EXTRA_F14_DATA::ID => {
37062 SERIAL_UDB_EXTRA_F14_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F14)
37063 }
37064 SERIAL_UDB_EXTRA_F15_DATA::ID => {
37065 SERIAL_UDB_EXTRA_F15_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F15)
37066 }
37067 SERIAL_UDB_EXTRA_F16_DATA::ID => {
37068 SERIAL_UDB_EXTRA_F16_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F16)
37069 }
37070 SERIAL_UDB_EXTRA_F17_DATA::ID => {
37071 SERIAL_UDB_EXTRA_F17_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F17)
37072 }
37073 SERIAL_UDB_EXTRA_F18_DATA::ID => {
37074 SERIAL_UDB_EXTRA_F18_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F18)
37075 }
37076 SERIAL_UDB_EXTRA_F19_DATA::ID => {
37077 SERIAL_UDB_EXTRA_F19_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F19)
37078 }
37079 SERIAL_UDB_EXTRA_F20_DATA::ID => {
37080 SERIAL_UDB_EXTRA_F20_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F20)
37081 }
37082 SERIAL_UDB_EXTRA_F21_DATA::ID => {
37083 SERIAL_UDB_EXTRA_F21_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F21)
37084 }
37085 SERIAL_UDB_EXTRA_F22_DATA::ID => {
37086 SERIAL_UDB_EXTRA_F22_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F22)
37087 }
37088 SERIAL_UDB_EXTRA_F2_A_DATA::ID => {
37089 SERIAL_UDB_EXTRA_F2_A_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F2_A)
37090 }
37091 SERIAL_UDB_EXTRA_F2_B_DATA::ID => {
37092 SERIAL_UDB_EXTRA_F2_B_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F2_B)
37093 }
37094 SERIAL_UDB_EXTRA_F4_DATA::ID => {
37095 SERIAL_UDB_EXTRA_F4_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F4)
37096 }
37097 SERIAL_UDB_EXTRA_F5_DATA::ID => {
37098 SERIAL_UDB_EXTRA_F5_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F5)
37099 }
37100 SERIAL_UDB_EXTRA_F6_DATA::ID => {
37101 SERIAL_UDB_EXTRA_F6_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F6)
37102 }
37103 SERIAL_UDB_EXTRA_F7_DATA::ID => {
37104 SERIAL_UDB_EXTRA_F7_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F7)
37105 }
37106 SERIAL_UDB_EXTRA_F8_DATA::ID => {
37107 SERIAL_UDB_EXTRA_F8_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F8)
37108 }
37109 SERVO_OUTPUT_RAW_DATA::ID => {
37110 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
37111 }
37112 SETUP_SIGNING_DATA::ID => {
37113 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
37114 }
37115 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
37116 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
37117 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
37118 }
37119 SET_ATTITUDE_TARGET_DATA::ID => {
37120 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
37121 }
37122 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
37123 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
37124 }
37125 SET_HOME_POSITION_DATA::ID => {
37126 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
37127 }
37128 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
37129 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
37130 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
37131 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
37132 }
37133 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
37134 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
37135 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
37136 }
37137 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
37138 SMART_BATTERY_INFO_DATA::ID => {
37139 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
37140 }
37141 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
37142 STORAGE_INFORMATION_DATA::ID => {
37143 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
37144 }
37145 SUPPORTED_TUNES_DATA::ID => {
37146 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
37147 }
37148 SYSTEM_TIME_DATA::ID => {
37149 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
37150 }
37151 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
37152 TERRAIN_CHECK_DATA::ID => {
37153 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
37154 }
37155 TERRAIN_DATA_DATA::ID => {
37156 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
37157 }
37158 TERRAIN_REPORT_DATA::ID => {
37159 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
37160 }
37161 TERRAIN_REQUEST_DATA::ID => {
37162 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
37163 }
37164 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
37165 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
37166 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
37167 .map(Self::TIME_ESTIMATE_TO_TARGET)
37168 }
37169 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
37170 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
37171 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
37172 }
37173 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
37174 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
37175 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
37176 }
37177 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
37178 UAVCAN_NODE_INFO_DATA::ID => {
37179 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
37180 }
37181 UAVCAN_NODE_STATUS_DATA::ID => {
37182 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
37183 }
37184 UTM_GLOBAL_POSITION_DATA::ID => {
37185 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
37186 }
37187 V2_EXTENSION_DATA::ID => {
37188 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
37189 }
37190 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
37191 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
37192 VICON_POSITION_ESTIMATE_DATA::ID => {
37193 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
37194 .map(Self::VICON_POSITION_ESTIMATE)
37195 }
37196 VIDEO_STREAM_INFORMATION_DATA::ID => {
37197 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
37198 .map(Self::VIDEO_STREAM_INFORMATION)
37199 }
37200 VIDEO_STREAM_STATUS_DATA::ID => {
37201 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
37202 }
37203 VISION_POSITION_ESTIMATE_DATA::ID => {
37204 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
37205 .map(Self::VISION_POSITION_ESTIMATE)
37206 }
37207 VISION_SPEED_ESTIMATE_DATA::ID => {
37208 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
37209 }
37210 WHEEL_DISTANCE_DATA::ID => {
37211 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
37212 }
37213 WIFI_CONFIG_AP_DATA::ID => {
37214 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
37215 }
37216 WINCH_STATUS_DATA::ID => {
37217 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
37218 }
37219 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
37220 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
37221 }
37222 }
37223 fn message_name(&self) -> &'static str {
37224 match self {
37225 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
37226 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
37227 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
37228 Self::AIRSPEEDS(..) => AIRSPEEDS_DATA::NAME,
37229 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
37230 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
37231 Self::ALTITUDES(..) => ALTITUDES_DATA::NAME,
37232 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
37233 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
37234 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
37235 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
37236 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
37237 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
37238 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
37239 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
37240 }
37241 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
37242 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
37243 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
37244 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
37245 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
37246 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
37247 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
37248 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
37249 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
37250 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
37251 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
37252 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
37253 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
37254 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
37255 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
37256 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
37257 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
37258 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
37259 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
37260 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
37261 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
37262 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
37263 Self::COLLISION(..) => COLLISION_DATA::NAME,
37264 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
37265 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
37266 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
37267 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
37268 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
37269 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
37270 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
37271 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
37272 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
37273 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
37274 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
37275 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
37276 Self::DEBUG(..) => DEBUG_DATA::NAME,
37277 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
37278 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
37279 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
37280 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
37281 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
37282 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
37283 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
37284 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
37285 Self::EVENT(..) => EVENT_DATA::NAME,
37286 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
37287 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
37288 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
37289 Self::FLEXIFUNCTION_BUFFER_FUNCTION(..) => FLEXIFUNCTION_BUFFER_FUNCTION_DATA::NAME,
37290 Self::FLEXIFUNCTION_BUFFER_FUNCTION_ACK(..) => {
37291 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::NAME
37292 }
37293 Self::FLEXIFUNCTION_COMMAND(..) => FLEXIFUNCTION_COMMAND_DATA::NAME,
37294 Self::FLEXIFUNCTION_COMMAND_ACK(..) => FLEXIFUNCTION_COMMAND_ACK_DATA::NAME,
37295 Self::FLEXIFUNCTION_DIRECTORY(..) => FLEXIFUNCTION_DIRECTORY_DATA::NAME,
37296 Self::FLEXIFUNCTION_DIRECTORY_ACK(..) => FLEXIFUNCTION_DIRECTORY_ACK_DATA::NAME,
37297 Self::FLEXIFUNCTION_READ_REQ(..) => FLEXIFUNCTION_READ_REQ_DATA::NAME,
37298 Self::FLEXIFUNCTION_SET(..) => FLEXIFUNCTION_SET_DATA::NAME,
37299 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
37300 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
37301 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
37302 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
37303 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
37304 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
37305 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
37306 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
37307 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
37308 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
37309 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
37310 }
37311 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
37312 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
37313 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
37314 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
37315 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
37316 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
37317 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
37318 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
37319 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
37320 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
37321 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
37322 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
37323 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
37324 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
37325 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
37326 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
37327 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
37328 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
37329 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
37330 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
37331 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
37332 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
37333 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
37334 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
37335 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
37336 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
37337 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
37338 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
37339 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
37340 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
37341 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
37342 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
37343 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
37344 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
37345 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
37346 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
37347 }
37348 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
37349 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
37350 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
37351 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
37352 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
37353 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
37354 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
37355 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
37356 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
37357 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
37358 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
37359 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
37360 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
37361 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
37362 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
37363 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
37364 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
37365 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
37366 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
37367 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
37368 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
37369 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
37370 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
37371 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
37372 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
37373 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
37374 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
37375 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
37376 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
37377 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
37378 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
37379 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
37380 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
37381 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
37382 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
37383 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
37384 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
37385 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
37386 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
37387 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
37388 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
37389 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
37390 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
37391 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
37392 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
37393 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
37394 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
37395 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
37396 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
37397 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
37398 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
37399 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
37400 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
37401 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
37402 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
37403 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
37404 Self::PING(..) => PING_DATA::NAME,
37405 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
37406 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
37407 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
37408 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
37409 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
37410 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
37411 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
37412 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
37413 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
37414 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
37415 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
37416 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
37417 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
37418 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
37419 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
37420 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
37421 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
37422 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
37423 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
37424 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
37425 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
37426 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
37427 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
37428 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
37429 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
37430 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
37431 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
37432 Self::SERIAL_UDB_EXTRA_F13(..) => SERIAL_UDB_EXTRA_F13_DATA::NAME,
37433 Self::SERIAL_UDB_EXTRA_F14(..) => SERIAL_UDB_EXTRA_F14_DATA::NAME,
37434 Self::SERIAL_UDB_EXTRA_F15(..) => SERIAL_UDB_EXTRA_F15_DATA::NAME,
37435 Self::SERIAL_UDB_EXTRA_F16(..) => SERIAL_UDB_EXTRA_F16_DATA::NAME,
37436 Self::SERIAL_UDB_EXTRA_F17(..) => SERIAL_UDB_EXTRA_F17_DATA::NAME,
37437 Self::SERIAL_UDB_EXTRA_F18(..) => SERIAL_UDB_EXTRA_F18_DATA::NAME,
37438 Self::SERIAL_UDB_EXTRA_F19(..) => SERIAL_UDB_EXTRA_F19_DATA::NAME,
37439 Self::SERIAL_UDB_EXTRA_F20(..) => SERIAL_UDB_EXTRA_F20_DATA::NAME,
37440 Self::SERIAL_UDB_EXTRA_F21(..) => SERIAL_UDB_EXTRA_F21_DATA::NAME,
37441 Self::SERIAL_UDB_EXTRA_F22(..) => SERIAL_UDB_EXTRA_F22_DATA::NAME,
37442 Self::SERIAL_UDB_EXTRA_F2_A(..) => SERIAL_UDB_EXTRA_F2_A_DATA::NAME,
37443 Self::SERIAL_UDB_EXTRA_F2_B(..) => SERIAL_UDB_EXTRA_F2_B_DATA::NAME,
37444 Self::SERIAL_UDB_EXTRA_F4(..) => SERIAL_UDB_EXTRA_F4_DATA::NAME,
37445 Self::SERIAL_UDB_EXTRA_F5(..) => SERIAL_UDB_EXTRA_F5_DATA::NAME,
37446 Self::SERIAL_UDB_EXTRA_F6(..) => SERIAL_UDB_EXTRA_F6_DATA::NAME,
37447 Self::SERIAL_UDB_EXTRA_F7(..) => SERIAL_UDB_EXTRA_F7_DATA::NAME,
37448 Self::SERIAL_UDB_EXTRA_F8(..) => SERIAL_UDB_EXTRA_F8_DATA::NAME,
37449 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
37450 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
37451 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
37452 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
37453 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
37454 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
37455 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
37456 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
37457 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
37458 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
37459 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
37460 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
37461 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
37462 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
37463 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
37464 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
37465 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
37466 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
37467 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
37468 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
37469 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
37470 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
37471 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
37472 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
37473 }
37474 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
37475 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
37476 }
37477 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
37478 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
37479 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
37480 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
37481 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
37482 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
37483 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
37484 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
37485 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
37486 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
37487 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
37488 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
37489 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
37490 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
37491 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
37492 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
37493 }
37494 }
37495 fn message_id(&self) -> u32 {
37496 match self {
37497 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
37498 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
37499 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
37500 Self::AIRSPEEDS(..) => AIRSPEEDS_DATA::ID,
37501 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
37502 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
37503 Self::ALTITUDES(..) => ALTITUDES_DATA::ID,
37504 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
37505 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
37506 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
37507 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
37508 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
37509 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
37510 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
37511 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
37512 }
37513 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
37514 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
37515 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
37516 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
37517 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
37518 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
37519 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
37520 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
37521 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
37522 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
37523 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
37524 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
37525 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
37526 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
37527 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
37528 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
37529 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
37530 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
37531 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
37532 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
37533 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
37534 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
37535 Self::COLLISION(..) => COLLISION_DATA::ID,
37536 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
37537 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
37538 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
37539 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
37540 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
37541 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
37542 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
37543 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
37544 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
37545 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
37546 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
37547 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
37548 Self::DEBUG(..) => DEBUG_DATA::ID,
37549 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
37550 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
37551 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
37552 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
37553 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
37554 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
37555 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
37556 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
37557 Self::EVENT(..) => EVENT_DATA::ID,
37558 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
37559 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
37560 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
37561 Self::FLEXIFUNCTION_BUFFER_FUNCTION(..) => FLEXIFUNCTION_BUFFER_FUNCTION_DATA::ID,
37562 Self::FLEXIFUNCTION_BUFFER_FUNCTION_ACK(..) => {
37563 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::ID
37564 }
37565 Self::FLEXIFUNCTION_COMMAND(..) => FLEXIFUNCTION_COMMAND_DATA::ID,
37566 Self::FLEXIFUNCTION_COMMAND_ACK(..) => FLEXIFUNCTION_COMMAND_ACK_DATA::ID,
37567 Self::FLEXIFUNCTION_DIRECTORY(..) => FLEXIFUNCTION_DIRECTORY_DATA::ID,
37568 Self::FLEXIFUNCTION_DIRECTORY_ACK(..) => FLEXIFUNCTION_DIRECTORY_ACK_DATA::ID,
37569 Self::FLEXIFUNCTION_READ_REQ(..) => FLEXIFUNCTION_READ_REQ_DATA::ID,
37570 Self::FLEXIFUNCTION_SET(..) => FLEXIFUNCTION_SET_DATA::ID,
37571 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
37572 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
37573 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
37574 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
37575 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
37576 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
37577 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
37578 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
37579 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
37580 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
37581 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
37582 }
37583 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
37584 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
37585 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
37586 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
37587 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
37588 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
37589 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
37590 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
37591 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
37592 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
37593 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
37594 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
37595 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
37596 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
37597 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
37598 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
37599 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
37600 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
37601 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
37602 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
37603 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
37604 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
37605 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
37606 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
37607 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
37608 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
37609 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
37610 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
37611 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
37612 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
37613 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
37614 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
37615 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
37616 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
37617 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
37618 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
37619 }
37620 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
37621 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
37622 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
37623 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
37624 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
37625 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
37626 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
37627 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
37628 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
37629 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
37630 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
37631 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
37632 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
37633 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
37634 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
37635 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
37636 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
37637 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
37638 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
37639 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
37640 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
37641 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
37642 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
37643 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
37644 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
37645 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
37646 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
37647 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
37648 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
37649 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
37650 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
37651 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
37652 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
37653 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
37654 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
37655 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
37656 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
37657 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
37658 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
37659 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
37660 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
37661 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
37662 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
37663 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
37664 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
37665 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
37666 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
37667 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
37668 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
37669 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
37670 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
37671 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
37672 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
37673 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
37674 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
37675 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
37676 Self::PING(..) => PING_DATA::ID,
37677 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
37678 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
37679 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
37680 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
37681 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
37682 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
37683 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
37684 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
37685 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
37686 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
37687 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
37688 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
37689 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
37690 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
37691 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
37692 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
37693 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
37694 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
37695 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
37696 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
37697 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
37698 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
37699 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
37700 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
37701 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
37702 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
37703 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
37704 Self::SERIAL_UDB_EXTRA_F13(..) => SERIAL_UDB_EXTRA_F13_DATA::ID,
37705 Self::SERIAL_UDB_EXTRA_F14(..) => SERIAL_UDB_EXTRA_F14_DATA::ID,
37706 Self::SERIAL_UDB_EXTRA_F15(..) => SERIAL_UDB_EXTRA_F15_DATA::ID,
37707 Self::SERIAL_UDB_EXTRA_F16(..) => SERIAL_UDB_EXTRA_F16_DATA::ID,
37708 Self::SERIAL_UDB_EXTRA_F17(..) => SERIAL_UDB_EXTRA_F17_DATA::ID,
37709 Self::SERIAL_UDB_EXTRA_F18(..) => SERIAL_UDB_EXTRA_F18_DATA::ID,
37710 Self::SERIAL_UDB_EXTRA_F19(..) => SERIAL_UDB_EXTRA_F19_DATA::ID,
37711 Self::SERIAL_UDB_EXTRA_F20(..) => SERIAL_UDB_EXTRA_F20_DATA::ID,
37712 Self::SERIAL_UDB_EXTRA_F21(..) => SERIAL_UDB_EXTRA_F21_DATA::ID,
37713 Self::SERIAL_UDB_EXTRA_F22(..) => SERIAL_UDB_EXTRA_F22_DATA::ID,
37714 Self::SERIAL_UDB_EXTRA_F2_A(..) => SERIAL_UDB_EXTRA_F2_A_DATA::ID,
37715 Self::SERIAL_UDB_EXTRA_F2_B(..) => SERIAL_UDB_EXTRA_F2_B_DATA::ID,
37716 Self::SERIAL_UDB_EXTRA_F4(..) => SERIAL_UDB_EXTRA_F4_DATA::ID,
37717 Self::SERIAL_UDB_EXTRA_F5(..) => SERIAL_UDB_EXTRA_F5_DATA::ID,
37718 Self::SERIAL_UDB_EXTRA_F6(..) => SERIAL_UDB_EXTRA_F6_DATA::ID,
37719 Self::SERIAL_UDB_EXTRA_F7(..) => SERIAL_UDB_EXTRA_F7_DATA::ID,
37720 Self::SERIAL_UDB_EXTRA_F8(..) => SERIAL_UDB_EXTRA_F8_DATA::ID,
37721 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
37722 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
37723 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
37724 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
37725 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
37726 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
37727 Self::SET_MODE(..) => SET_MODE_DATA::ID,
37728 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
37729 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
37730 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
37731 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
37732 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
37733 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
37734 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
37735 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
37736 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
37737 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
37738 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
37739 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
37740 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
37741 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
37742 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
37743 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
37744 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
37745 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
37746 }
37747 Self::TUNNEL(..) => TUNNEL_DATA::ID,
37748 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
37749 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
37750 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
37751 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
37752 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
37753 Self::VIBRATION(..) => VIBRATION_DATA::ID,
37754 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
37755 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
37756 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
37757 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
37758 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
37759 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
37760 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
37761 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
37762 Self::WIND_COV(..) => WIND_COV_DATA::ID,
37763 }
37764 }
37765 fn message_id_from_name(name: &str) -> Option<u32> {
37766 match name {
37767 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
37768 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
37769 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
37770 AIRSPEEDS_DATA::NAME => Some(AIRSPEEDS_DATA::ID),
37771 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
37772 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
37773 ALTITUDES_DATA::NAME => Some(ALTITUDES_DATA::ID),
37774 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
37775 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
37776 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
37777 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
37778 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
37779 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
37780 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
37781 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
37782 }
37783 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
37784 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
37785 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
37786 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
37787 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
37788 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
37789 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
37790 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
37791 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
37792 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
37793 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
37794 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
37795 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
37796 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
37797 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
37798 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
37799 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
37800 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
37801 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
37802 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
37803 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
37804 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
37805 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
37806 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
37807 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
37808 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
37809 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
37810 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
37811 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
37812 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
37813 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
37814 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
37815 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
37816 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
37817 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
37818 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
37819 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
37820 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
37821 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
37822 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
37823 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
37824 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
37825 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
37826 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
37827 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
37828 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
37829 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
37830 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
37831 FLEXIFUNCTION_BUFFER_FUNCTION_DATA::NAME => {
37832 Some(FLEXIFUNCTION_BUFFER_FUNCTION_DATA::ID)
37833 }
37834 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::NAME => {
37835 Some(FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::ID)
37836 }
37837 FLEXIFUNCTION_COMMAND_DATA::NAME => Some(FLEXIFUNCTION_COMMAND_DATA::ID),
37838 FLEXIFUNCTION_COMMAND_ACK_DATA::NAME => Some(FLEXIFUNCTION_COMMAND_ACK_DATA::ID),
37839 FLEXIFUNCTION_DIRECTORY_DATA::NAME => Some(FLEXIFUNCTION_DIRECTORY_DATA::ID),
37840 FLEXIFUNCTION_DIRECTORY_ACK_DATA::NAME => Some(FLEXIFUNCTION_DIRECTORY_ACK_DATA::ID),
37841 FLEXIFUNCTION_READ_REQ_DATA::NAME => Some(FLEXIFUNCTION_READ_REQ_DATA::ID),
37842 FLEXIFUNCTION_SET_DATA::NAME => Some(FLEXIFUNCTION_SET_DATA::ID),
37843 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
37844 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
37845 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
37846 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
37847 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
37848 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
37849 }
37850 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
37851 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
37852 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
37853 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
37854 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
37855 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
37856 }
37857 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
37858 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
37859 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
37860 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
37861 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
37862 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
37863 }
37864 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
37865 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
37866 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
37867 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
37868 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
37869 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
37870 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
37871 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
37872 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
37873 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
37874 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
37875 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
37876 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
37877 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
37878 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
37879 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
37880 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
37881 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
37882 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
37883 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
37884 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
37885 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
37886 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
37887 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
37888 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
37889 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
37890 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
37891 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
37892 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
37893 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
37894 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
37895 }
37896 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
37897 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
37898 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
37899 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
37900 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
37901 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
37902 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
37903 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
37904 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
37905 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
37906 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
37907 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
37908 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
37909 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
37910 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
37911 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
37912 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
37913 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
37914 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
37915 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
37916 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
37917 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
37918 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
37919 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
37920 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
37921 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
37922 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
37923 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
37924 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
37925 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
37926 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
37927 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
37928 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
37929 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
37930 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
37931 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
37932 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
37933 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
37934 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
37935 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
37936 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
37937 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
37938 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
37939 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
37940 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
37941 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
37942 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
37943 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
37944 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
37945 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
37946 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
37947 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
37948 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
37949 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
37950 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
37951 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
37952 PING_DATA::NAME => Some(PING_DATA::ID),
37953 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
37954 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
37955 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
37956 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
37957 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
37958 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
37959 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
37960 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
37961 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
37962 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
37963 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
37964 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
37965 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
37966 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
37967 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
37968 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
37969 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
37970 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
37971 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
37972 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
37973 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
37974 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
37975 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
37976 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
37977 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
37978 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
37979 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
37980 SERIAL_UDB_EXTRA_F13_DATA::NAME => Some(SERIAL_UDB_EXTRA_F13_DATA::ID),
37981 SERIAL_UDB_EXTRA_F14_DATA::NAME => Some(SERIAL_UDB_EXTRA_F14_DATA::ID),
37982 SERIAL_UDB_EXTRA_F15_DATA::NAME => Some(SERIAL_UDB_EXTRA_F15_DATA::ID),
37983 SERIAL_UDB_EXTRA_F16_DATA::NAME => Some(SERIAL_UDB_EXTRA_F16_DATA::ID),
37984 SERIAL_UDB_EXTRA_F17_DATA::NAME => Some(SERIAL_UDB_EXTRA_F17_DATA::ID),
37985 SERIAL_UDB_EXTRA_F18_DATA::NAME => Some(SERIAL_UDB_EXTRA_F18_DATA::ID),
37986 SERIAL_UDB_EXTRA_F19_DATA::NAME => Some(SERIAL_UDB_EXTRA_F19_DATA::ID),
37987 SERIAL_UDB_EXTRA_F20_DATA::NAME => Some(SERIAL_UDB_EXTRA_F20_DATA::ID),
37988 SERIAL_UDB_EXTRA_F21_DATA::NAME => Some(SERIAL_UDB_EXTRA_F21_DATA::ID),
37989 SERIAL_UDB_EXTRA_F22_DATA::NAME => Some(SERIAL_UDB_EXTRA_F22_DATA::ID),
37990 SERIAL_UDB_EXTRA_F2_A_DATA::NAME => Some(SERIAL_UDB_EXTRA_F2_A_DATA::ID),
37991 SERIAL_UDB_EXTRA_F2_B_DATA::NAME => Some(SERIAL_UDB_EXTRA_F2_B_DATA::ID),
37992 SERIAL_UDB_EXTRA_F4_DATA::NAME => Some(SERIAL_UDB_EXTRA_F4_DATA::ID),
37993 SERIAL_UDB_EXTRA_F5_DATA::NAME => Some(SERIAL_UDB_EXTRA_F5_DATA::ID),
37994 SERIAL_UDB_EXTRA_F6_DATA::NAME => Some(SERIAL_UDB_EXTRA_F6_DATA::ID),
37995 SERIAL_UDB_EXTRA_F7_DATA::NAME => Some(SERIAL_UDB_EXTRA_F7_DATA::ID),
37996 SERIAL_UDB_EXTRA_F8_DATA::NAME => Some(SERIAL_UDB_EXTRA_F8_DATA::ID),
37997 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
37998 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
37999 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
38000 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
38001 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
38002 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
38003 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
38004 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
38005 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
38006 }
38007 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
38008 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
38009 }
38010 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
38011 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
38012 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
38013 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
38014 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
38015 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
38016 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
38017 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
38018 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
38019 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
38020 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
38021 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
38022 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
38023 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
38024 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
38025 }
38026 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
38027 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
38028 }
38029 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
38030 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
38031 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
38032 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
38033 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
38034 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
38035 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
38036 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
38037 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
38038 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
38039 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
38040 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
38041 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
38042 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
38043 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
38044 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
38045 _ => None,
38046 }
38047 }
38048 fn default_message_from_id(id: u32) -> Option<Self> {
38049 match id {
38050 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
38051 ACTUATOR_CONTROL_TARGET_DATA::default(),
38052 )),
38053 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
38054 ACTUATOR_OUTPUT_STATUS_DATA::default(),
38055 )),
38056 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
38057 AIRSPEEDS_DATA::ID => Some(Self::AIRSPEEDS(AIRSPEEDS_DATA::default())),
38058 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
38059 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
38060 ALTITUDES_DATA::ID => Some(Self::ALTITUDES(ALTITUDES_DATA::default())),
38061 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
38062 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
38063 ATTITUDE_QUATERNION_DATA::default(),
38064 )),
38065 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
38066 ATTITUDE_QUATERNION_COV_DATA::default(),
38067 )),
38068 ATTITUDE_TARGET_DATA::ID => {
38069 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
38070 }
38071 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
38072 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
38073 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
38074 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
38075 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
38076 ))
38077 }
38078 AUTOPILOT_VERSION_DATA::ID => {
38079 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
38080 }
38081 AVAILABLE_MODES_DATA::ID => {
38082 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
38083 }
38084 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
38085 AVAILABLE_MODES_MONITOR_DATA::default(),
38086 )),
38087 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
38088 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
38089 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
38090 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
38091 CAMERA_CAPTURE_STATUS_DATA::default(),
38092 )),
38093 CAMERA_FOV_STATUS_DATA::ID => {
38094 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
38095 }
38096 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
38097 CAMERA_IMAGE_CAPTURED_DATA::default(),
38098 )),
38099 CAMERA_INFORMATION_DATA::ID => {
38100 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
38101 }
38102 CAMERA_SETTINGS_DATA::ID => {
38103 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
38104 }
38105 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
38106 CAMERA_THERMAL_RANGE_DATA::default(),
38107 )),
38108 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
38109 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
38110 )),
38111 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
38112 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
38113 )),
38114 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
38115 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
38116 CAN_FILTER_MODIFY_DATA::ID => {
38117 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
38118 }
38119 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
38120 CELLULAR_CONFIG_DATA::ID => {
38121 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
38122 }
38123 CELLULAR_STATUS_DATA::ID => {
38124 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
38125 }
38126 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
38127 CHANGE_OPERATOR_CONTROL_DATA::default(),
38128 )),
38129 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
38130 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
38131 )),
38132 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
38133 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
38134 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
38135 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
38136 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
38137 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
38138 COMPONENT_INFORMATION_DATA::default(),
38139 )),
38140 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
38141 COMPONENT_INFORMATION_BASIC_DATA::default(),
38142 )),
38143 COMPONENT_METADATA_DATA::ID => {
38144 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
38145 }
38146 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
38147 CONTROL_SYSTEM_STATE_DATA::default(),
38148 )),
38149 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
38150 CURRENT_EVENT_SEQUENCE_DATA::default(),
38151 )),
38152 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
38153 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
38154 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
38155 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
38156 )),
38157 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
38158 DEBUG_FLOAT_ARRAY_DATA::ID => {
38159 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
38160 }
38161 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
38162 DISTANCE_SENSOR_DATA::ID => {
38163 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
38164 }
38165 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
38166 ENCAPSULATED_DATA_DATA::ID => {
38167 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
38168 }
38169 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
38170 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
38171 ESTIMATOR_STATUS_DATA::ID => {
38172 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
38173 }
38174 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
38175 EXTENDED_SYS_STATE_DATA::ID => {
38176 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
38177 }
38178 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
38179 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
38180 FILE_TRANSFER_PROTOCOL_DATA::default(),
38181 )),
38182 FLEXIFUNCTION_BUFFER_FUNCTION_DATA::ID => Some(Self::FLEXIFUNCTION_BUFFER_FUNCTION(
38183 FLEXIFUNCTION_BUFFER_FUNCTION_DATA::default(),
38184 )),
38185 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::ID => {
38186 Some(Self::FLEXIFUNCTION_BUFFER_FUNCTION_ACK(
38187 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::default(),
38188 ))
38189 }
38190 FLEXIFUNCTION_COMMAND_DATA::ID => Some(Self::FLEXIFUNCTION_COMMAND(
38191 FLEXIFUNCTION_COMMAND_DATA::default(),
38192 )),
38193 FLEXIFUNCTION_COMMAND_ACK_DATA::ID => Some(Self::FLEXIFUNCTION_COMMAND_ACK(
38194 FLEXIFUNCTION_COMMAND_ACK_DATA::default(),
38195 )),
38196 FLEXIFUNCTION_DIRECTORY_DATA::ID => Some(Self::FLEXIFUNCTION_DIRECTORY(
38197 FLEXIFUNCTION_DIRECTORY_DATA::default(),
38198 )),
38199 FLEXIFUNCTION_DIRECTORY_ACK_DATA::ID => Some(Self::FLEXIFUNCTION_DIRECTORY_ACK(
38200 FLEXIFUNCTION_DIRECTORY_ACK_DATA::default(),
38201 )),
38202 FLEXIFUNCTION_READ_REQ_DATA::ID => Some(Self::FLEXIFUNCTION_READ_REQ(
38203 FLEXIFUNCTION_READ_REQ_DATA::default(),
38204 )),
38205 FLEXIFUNCTION_SET_DATA::ID => {
38206 Some(Self::FLEXIFUNCTION_SET(FLEXIFUNCTION_SET_DATA::default()))
38207 }
38208 FLIGHT_INFORMATION_DATA::ID => {
38209 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
38210 }
38211 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
38212 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
38213 GENERATOR_STATUS_DATA::ID => {
38214 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
38215 }
38216 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
38217 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
38218 )),
38219 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
38220 GIMBAL_DEVICE_INFORMATION_DATA::default(),
38221 )),
38222 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
38223 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
38224 )),
38225 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
38226 GIMBAL_MANAGER_INFORMATION_DATA::default(),
38227 )),
38228 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
38229 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
38230 )),
38231 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
38232 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
38233 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
38234 ))
38235 }
38236 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
38237 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
38238 )),
38239 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
38240 GIMBAL_MANAGER_STATUS_DATA::default(),
38241 )),
38242 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
38243 GLOBAL_POSITION_INT_DATA::default(),
38244 )),
38245 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
38246 GLOBAL_POSITION_INT_COV_DATA::default(),
38247 )),
38248 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
38249 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
38250 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
38251 ))
38252 }
38253 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
38254 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
38255 GPS_GLOBAL_ORIGIN_DATA::ID => {
38256 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
38257 }
38258 GPS_INJECT_DATA_DATA::ID => {
38259 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
38260 }
38261 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
38262 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
38263 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
38264 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
38265 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
38266 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
38267 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
38268 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
38269 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
38270 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
38271 HIL_ACTUATOR_CONTROLS_DATA::default(),
38272 )),
38273 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
38274 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
38275 HIL_OPTICAL_FLOW_DATA::ID => {
38276 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
38277 }
38278 HIL_RC_INPUTS_RAW_DATA::ID => {
38279 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
38280 }
38281 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
38282 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
38283 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
38284 HIL_STATE_QUATERNION_DATA::default(),
38285 )),
38286 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
38287 HYGROMETER_SENSOR_DATA::ID => {
38288 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
38289 }
38290 ILLUMINATOR_STATUS_DATA::ID => {
38291 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
38292 }
38293 ISBD_LINK_STATUS_DATA::ID => {
38294 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
38295 }
38296 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
38297 LINK_NODE_STATUS_DATA::ID => {
38298 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
38299 }
38300 LOCAL_POSITION_NED_DATA::ID => {
38301 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
38302 }
38303 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
38304 LOCAL_POSITION_NED_COV_DATA::default(),
38305 )),
38306 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
38307 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
38308 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
38309 ))
38310 }
38311 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
38312 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
38313 LOGGING_DATA_ACKED_DATA::ID => {
38314 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
38315 }
38316 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
38317 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
38318 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
38319 LOG_REQUEST_DATA_DATA::ID => {
38320 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
38321 }
38322 LOG_REQUEST_END_DATA::ID => {
38323 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
38324 }
38325 LOG_REQUEST_LIST_DATA::ID => {
38326 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
38327 }
38328 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
38329 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
38330 MANUAL_SETPOINT_DATA::ID => {
38331 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
38332 }
38333 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
38334 MESSAGE_INTERVAL_DATA::ID => {
38335 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
38336 }
38337 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
38338 MISSION_CLEAR_ALL_DATA::ID => {
38339 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
38340 }
38341 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
38342 MISSION_CURRENT_DATA::ID => {
38343 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
38344 }
38345 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
38346 MISSION_ITEM_INT_DATA::ID => {
38347 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
38348 }
38349 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
38350 MISSION_ITEM_REACHED_DATA::default(),
38351 )),
38352 MISSION_REQUEST_DATA::ID => {
38353 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
38354 }
38355 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
38356 MISSION_REQUEST_INT_DATA::default(),
38357 )),
38358 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
38359 MISSION_REQUEST_LIST_DATA::default(),
38360 )),
38361 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
38362 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
38363 )),
38364 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
38365 MISSION_SET_CURRENT_DATA::default(),
38366 )),
38367 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
38368 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
38369 )),
38370 MOUNT_ORIENTATION_DATA::ID => {
38371 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
38372 }
38373 NAMED_VALUE_FLOAT_DATA::ID => {
38374 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
38375 }
38376 NAMED_VALUE_INT_DATA::ID => {
38377 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
38378 }
38379 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
38380 NAV_CONTROLLER_OUTPUT_DATA::default(),
38381 )),
38382 OBSTACLE_DISTANCE_DATA::ID => {
38383 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
38384 }
38385 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
38386 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
38387 ONBOARD_COMPUTER_STATUS_DATA::default(),
38388 )),
38389 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
38390 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
38391 )),
38392 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
38393 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
38394 )),
38395 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
38396 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
38397 )),
38398 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
38399 OPEN_DRONE_ID_LOCATION_DATA::default(),
38400 )),
38401 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
38402 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
38403 )),
38404 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
38405 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
38406 )),
38407 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
38408 OPEN_DRONE_ID_SELF_ID_DATA::default(),
38409 )),
38410 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
38411 OPEN_DRONE_ID_SYSTEM_DATA::default(),
38412 )),
38413 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
38414 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
38415 )),
38416 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
38417 OPTICAL_FLOW_RAD_DATA::ID => {
38418 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
38419 }
38420 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
38421 ORBIT_EXECUTION_STATUS_DATA::default(),
38422 )),
38423 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
38424 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
38425 PARAM_EXT_REQUEST_LIST_DATA::default(),
38426 )),
38427 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
38428 PARAM_EXT_REQUEST_READ_DATA::default(),
38429 )),
38430 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
38431 PARAM_EXT_VALUE_DATA::ID => {
38432 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
38433 }
38434 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
38435 PARAM_REQUEST_LIST_DATA::ID => {
38436 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
38437 }
38438 PARAM_REQUEST_READ_DATA::ID => {
38439 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
38440 }
38441 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
38442 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
38443 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
38444 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
38445 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
38446 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
38447 POSITION_TARGET_GLOBAL_INT_DATA::default(),
38448 )),
38449 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
38450 POSITION_TARGET_LOCAL_NED_DATA::default(),
38451 )),
38452 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
38453 PROTOCOL_VERSION_DATA::ID => {
38454 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
38455 }
38456 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
38457 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
38458 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
38459 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
38460 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
38461 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
38462 RC_CHANNELS_OVERRIDE_DATA::default(),
38463 )),
38464 RC_CHANNELS_RAW_DATA::ID => {
38465 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
38466 }
38467 RC_CHANNELS_SCALED_DATA::ID => {
38468 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
38469 }
38470 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
38471 REQUEST_DATA_STREAM_DATA::default(),
38472 )),
38473 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
38474 RESOURCE_REQUEST_DATA::ID => {
38475 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
38476 }
38477 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
38478 RESPONSE_EVENT_ERROR_DATA::default(),
38479 )),
38480 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
38481 SAFETY_ALLOWED_AREA_DATA::default(),
38482 )),
38483 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
38484 SAFETY_SET_ALLOWED_AREA_DATA::default(),
38485 )),
38486 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
38487 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
38488 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
38489 SCALED_PRESSURE_DATA::ID => {
38490 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
38491 }
38492 SCALED_PRESSURE2_DATA::ID => {
38493 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
38494 }
38495 SCALED_PRESSURE3_DATA::ID => {
38496 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
38497 }
38498 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
38499 SERIAL_UDB_EXTRA_F13_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F13(
38500 SERIAL_UDB_EXTRA_F13_DATA::default(),
38501 )),
38502 SERIAL_UDB_EXTRA_F14_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F14(
38503 SERIAL_UDB_EXTRA_F14_DATA::default(),
38504 )),
38505 SERIAL_UDB_EXTRA_F15_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F15(
38506 SERIAL_UDB_EXTRA_F15_DATA::default(),
38507 )),
38508 SERIAL_UDB_EXTRA_F16_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F16(
38509 SERIAL_UDB_EXTRA_F16_DATA::default(),
38510 )),
38511 SERIAL_UDB_EXTRA_F17_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F17(
38512 SERIAL_UDB_EXTRA_F17_DATA::default(),
38513 )),
38514 SERIAL_UDB_EXTRA_F18_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F18(
38515 SERIAL_UDB_EXTRA_F18_DATA::default(),
38516 )),
38517 SERIAL_UDB_EXTRA_F19_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F19(
38518 SERIAL_UDB_EXTRA_F19_DATA::default(),
38519 )),
38520 SERIAL_UDB_EXTRA_F20_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F20(
38521 SERIAL_UDB_EXTRA_F20_DATA::default(),
38522 )),
38523 SERIAL_UDB_EXTRA_F21_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F21(
38524 SERIAL_UDB_EXTRA_F21_DATA::default(),
38525 )),
38526 SERIAL_UDB_EXTRA_F22_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F22(
38527 SERIAL_UDB_EXTRA_F22_DATA::default(),
38528 )),
38529 SERIAL_UDB_EXTRA_F2_A_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F2_A(
38530 SERIAL_UDB_EXTRA_F2_A_DATA::default(),
38531 )),
38532 SERIAL_UDB_EXTRA_F2_B_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F2_B(
38533 SERIAL_UDB_EXTRA_F2_B_DATA::default(),
38534 )),
38535 SERIAL_UDB_EXTRA_F4_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F4(
38536 SERIAL_UDB_EXTRA_F4_DATA::default(),
38537 )),
38538 SERIAL_UDB_EXTRA_F5_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F5(
38539 SERIAL_UDB_EXTRA_F5_DATA::default(),
38540 )),
38541 SERIAL_UDB_EXTRA_F6_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F6(
38542 SERIAL_UDB_EXTRA_F6_DATA::default(),
38543 )),
38544 SERIAL_UDB_EXTRA_F7_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F7(
38545 SERIAL_UDB_EXTRA_F7_DATA::default(),
38546 )),
38547 SERIAL_UDB_EXTRA_F8_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F8(
38548 SERIAL_UDB_EXTRA_F8_DATA::default(),
38549 )),
38550 SERVO_OUTPUT_RAW_DATA::ID => {
38551 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
38552 }
38553 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
38554 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
38555 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
38556 )),
38557 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
38558 SET_ATTITUDE_TARGET_DATA::default(),
38559 )),
38560 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
38561 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
38562 )),
38563 SET_HOME_POSITION_DATA::ID => {
38564 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
38565 }
38566 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
38567 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
38568 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
38569 )),
38570 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
38571 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
38572 )),
38573 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
38574 SMART_BATTERY_INFO_DATA::ID => {
38575 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
38576 }
38577 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
38578 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
38579 STORAGE_INFORMATION_DATA::default(),
38580 )),
38581 SUPPORTED_TUNES_DATA::ID => {
38582 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
38583 }
38584 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
38585 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
38586 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
38587 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
38588 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
38589 TERRAIN_REQUEST_DATA::ID => {
38590 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
38591 }
38592 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
38593 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
38594 TIME_ESTIMATE_TO_TARGET_DATA::default(),
38595 )),
38596 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
38597 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
38598 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
38599 ))
38600 }
38601 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
38602 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
38603 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
38604 ))
38605 }
38606 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
38607 UAVCAN_NODE_INFO_DATA::ID => {
38608 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
38609 }
38610 UAVCAN_NODE_STATUS_DATA::ID => {
38611 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
38612 }
38613 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
38614 UTM_GLOBAL_POSITION_DATA::default(),
38615 )),
38616 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
38617 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
38618 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
38619 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
38620 VICON_POSITION_ESTIMATE_DATA::default(),
38621 )),
38622 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
38623 VIDEO_STREAM_INFORMATION_DATA::default(),
38624 )),
38625 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
38626 VIDEO_STREAM_STATUS_DATA::default(),
38627 )),
38628 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
38629 VISION_POSITION_ESTIMATE_DATA::default(),
38630 )),
38631 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
38632 VISION_SPEED_ESTIMATE_DATA::default(),
38633 )),
38634 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
38635 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
38636 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
38637 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
38638 _ => None,
38639 }
38640 }
38641 #[cfg(feature = "arbitrary")]
38642 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
38643 match id {
38644 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
38645 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
38646 )),
38647 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
38648 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
38649 )),
38650 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
38651 AIRSPEEDS_DATA::ID => Some(Self::AIRSPEEDS(AIRSPEEDS_DATA::random(rng))),
38652 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
38653 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
38654 ALTITUDES_DATA::ID => Some(Self::ALTITUDES(ALTITUDES_DATA::random(rng))),
38655 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
38656 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
38657 ATTITUDE_QUATERNION_DATA::random(rng),
38658 )),
38659 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
38660 ATTITUDE_QUATERNION_COV_DATA::random(rng),
38661 )),
38662 ATTITUDE_TARGET_DATA::ID => {
38663 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
38664 }
38665 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
38666 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
38667 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
38668 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
38669 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
38670 ))
38671 }
38672 AUTOPILOT_VERSION_DATA::ID => {
38673 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
38674 }
38675 AVAILABLE_MODES_DATA::ID => {
38676 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
38677 }
38678 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
38679 AVAILABLE_MODES_MONITOR_DATA::random(rng),
38680 )),
38681 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
38682 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
38683 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
38684 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
38685 CAMERA_CAPTURE_STATUS_DATA::random(rng),
38686 )),
38687 CAMERA_FOV_STATUS_DATA::ID => {
38688 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
38689 }
38690 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
38691 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
38692 )),
38693 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
38694 CAMERA_INFORMATION_DATA::random(rng),
38695 )),
38696 CAMERA_SETTINGS_DATA::ID => {
38697 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
38698 }
38699 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
38700 CAMERA_THERMAL_RANGE_DATA::random(rng),
38701 )),
38702 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
38703 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
38704 )),
38705 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
38706 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
38707 )),
38708 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
38709 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
38710 CAN_FILTER_MODIFY_DATA::ID => {
38711 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
38712 }
38713 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
38714 CELLULAR_CONFIG_DATA::ID => {
38715 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
38716 }
38717 CELLULAR_STATUS_DATA::ID => {
38718 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
38719 }
38720 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
38721 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
38722 )),
38723 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
38724 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
38725 )),
38726 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
38727 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
38728 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
38729 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
38730 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
38731 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
38732 COMPONENT_INFORMATION_DATA::random(rng),
38733 )),
38734 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
38735 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
38736 )),
38737 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
38738 COMPONENT_METADATA_DATA::random(rng),
38739 )),
38740 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
38741 CONTROL_SYSTEM_STATE_DATA::random(rng),
38742 )),
38743 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
38744 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
38745 )),
38746 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
38747 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
38748 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
38749 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
38750 )),
38751 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
38752 DEBUG_FLOAT_ARRAY_DATA::ID => {
38753 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
38754 }
38755 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
38756 DISTANCE_SENSOR_DATA::ID => {
38757 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
38758 }
38759 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
38760 ENCAPSULATED_DATA_DATA::ID => {
38761 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
38762 }
38763 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
38764 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
38765 ESTIMATOR_STATUS_DATA::ID => {
38766 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
38767 }
38768 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
38769 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
38770 EXTENDED_SYS_STATE_DATA::random(rng),
38771 )),
38772 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
38773 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
38774 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
38775 )),
38776 FLEXIFUNCTION_BUFFER_FUNCTION_DATA::ID => Some(Self::FLEXIFUNCTION_BUFFER_FUNCTION(
38777 FLEXIFUNCTION_BUFFER_FUNCTION_DATA::random(rng),
38778 )),
38779 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::ID => {
38780 Some(Self::FLEXIFUNCTION_BUFFER_FUNCTION_ACK(
38781 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::random(rng),
38782 ))
38783 }
38784 FLEXIFUNCTION_COMMAND_DATA::ID => Some(Self::FLEXIFUNCTION_COMMAND(
38785 FLEXIFUNCTION_COMMAND_DATA::random(rng),
38786 )),
38787 FLEXIFUNCTION_COMMAND_ACK_DATA::ID => Some(Self::FLEXIFUNCTION_COMMAND_ACK(
38788 FLEXIFUNCTION_COMMAND_ACK_DATA::random(rng),
38789 )),
38790 FLEXIFUNCTION_DIRECTORY_DATA::ID => Some(Self::FLEXIFUNCTION_DIRECTORY(
38791 FLEXIFUNCTION_DIRECTORY_DATA::random(rng),
38792 )),
38793 FLEXIFUNCTION_DIRECTORY_ACK_DATA::ID => Some(Self::FLEXIFUNCTION_DIRECTORY_ACK(
38794 FLEXIFUNCTION_DIRECTORY_ACK_DATA::random(rng),
38795 )),
38796 FLEXIFUNCTION_READ_REQ_DATA::ID => Some(Self::FLEXIFUNCTION_READ_REQ(
38797 FLEXIFUNCTION_READ_REQ_DATA::random(rng),
38798 )),
38799 FLEXIFUNCTION_SET_DATA::ID => {
38800 Some(Self::FLEXIFUNCTION_SET(FLEXIFUNCTION_SET_DATA::random(rng)))
38801 }
38802 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
38803 FLIGHT_INFORMATION_DATA::random(rng),
38804 )),
38805 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
38806 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
38807 GENERATOR_STATUS_DATA::ID => {
38808 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
38809 }
38810 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
38811 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
38812 )),
38813 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
38814 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
38815 )),
38816 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
38817 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
38818 )),
38819 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
38820 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
38821 )),
38822 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
38823 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
38824 )),
38825 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
38826 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
38827 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
38828 ))
38829 }
38830 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
38831 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
38832 )),
38833 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
38834 GIMBAL_MANAGER_STATUS_DATA::random(rng),
38835 )),
38836 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
38837 GLOBAL_POSITION_INT_DATA::random(rng),
38838 )),
38839 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
38840 GLOBAL_POSITION_INT_COV_DATA::random(rng),
38841 )),
38842 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
38843 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
38844 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
38845 ))
38846 }
38847 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
38848 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
38849 GPS_GLOBAL_ORIGIN_DATA::ID => {
38850 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
38851 }
38852 GPS_INJECT_DATA_DATA::ID => {
38853 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
38854 }
38855 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
38856 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
38857 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
38858 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
38859 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
38860 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
38861 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
38862 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
38863 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
38864 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
38865 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
38866 )),
38867 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
38868 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
38869 HIL_OPTICAL_FLOW_DATA::ID => {
38870 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
38871 }
38872 HIL_RC_INPUTS_RAW_DATA::ID => {
38873 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
38874 }
38875 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
38876 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
38877 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
38878 HIL_STATE_QUATERNION_DATA::random(rng),
38879 )),
38880 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
38881 HYGROMETER_SENSOR_DATA::ID => {
38882 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
38883 }
38884 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
38885 ILLUMINATOR_STATUS_DATA::random(rng),
38886 )),
38887 ISBD_LINK_STATUS_DATA::ID => {
38888 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
38889 }
38890 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
38891 LINK_NODE_STATUS_DATA::ID => {
38892 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
38893 }
38894 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
38895 LOCAL_POSITION_NED_DATA::random(rng),
38896 )),
38897 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
38898 LOCAL_POSITION_NED_COV_DATA::random(rng),
38899 )),
38900 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
38901 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
38902 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
38903 ))
38904 }
38905 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
38906 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
38907 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
38908 LOGGING_DATA_ACKED_DATA::random(rng),
38909 )),
38910 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
38911 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
38912 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
38913 LOG_REQUEST_DATA_DATA::ID => {
38914 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
38915 }
38916 LOG_REQUEST_END_DATA::ID => {
38917 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
38918 }
38919 LOG_REQUEST_LIST_DATA::ID => {
38920 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
38921 }
38922 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
38923 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
38924 MANUAL_SETPOINT_DATA::ID => {
38925 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
38926 }
38927 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
38928 MESSAGE_INTERVAL_DATA::ID => {
38929 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
38930 }
38931 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
38932 MISSION_CLEAR_ALL_DATA::ID => {
38933 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
38934 }
38935 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
38936 MISSION_CURRENT_DATA::ID => {
38937 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
38938 }
38939 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
38940 MISSION_ITEM_INT_DATA::ID => {
38941 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
38942 }
38943 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
38944 MISSION_ITEM_REACHED_DATA::random(rng),
38945 )),
38946 MISSION_REQUEST_DATA::ID => {
38947 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
38948 }
38949 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
38950 MISSION_REQUEST_INT_DATA::random(rng),
38951 )),
38952 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
38953 MISSION_REQUEST_LIST_DATA::random(rng),
38954 )),
38955 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
38956 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
38957 )),
38958 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
38959 MISSION_SET_CURRENT_DATA::random(rng),
38960 )),
38961 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
38962 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
38963 )),
38964 MOUNT_ORIENTATION_DATA::ID => {
38965 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
38966 }
38967 NAMED_VALUE_FLOAT_DATA::ID => {
38968 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
38969 }
38970 NAMED_VALUE_INT_DATA::ID => {
38971 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
38972 }
38973 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
38974 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
38975 )),
38976 OBSTACLE_DISTANCE_DATA::ID => {
38977 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
38978 }
38979 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
38980 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
38981 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
38982 )),
38983 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
38984 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
38985 )),
38986 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
38987 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
38988 )),
38989 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
38990 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
38991 )),
38992 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
38993 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
38994 )),
38995 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
38996 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
38997 )),
38998 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
38999 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
39000 )),
39001 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
39002 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
39003 )),
39004 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
39005 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
39006 )),
39007 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
39008 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
39009 )),
39010 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
39011 OPTICAL_FLOW_RAD_DATA::ID => {
39012 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
39013 }
39014 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
39015 ORBIT_EXECUTION_STATUS_DATA::random(rng),
39016 )),
39017 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
39018 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
39019 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
39020 )),
39021 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
39022 PARAM_EXT_REQUEST_READ_DATA::random(rng),
39023 )),
39024 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
39025 PARAM_EXT_VALUE_DATA::ID => {
39026 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
39027 }
39028 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
39029 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
39030 PARAM_REQUEST_LIST_DATA::random(rng),
39031 )),
39032 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
39033 PARAM_REQUEST_READ_DATA::random(rng),
39034 )),
39035 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
39036 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
39037 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
39038 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
39039 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
39040 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
39041 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
39042 )),
39043 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
39044 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
39045 )),
39046 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
39047 PROTOCOL_VERSION_DATA::ID => {
39048 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
39049 }
39050 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
39051 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
39052 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
39053 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
39054 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
39055 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
39056 RC_CHANNELS_OVERRIDE_DATA::random(rng),
39057 )),
39058 RC_CHANNELS_RAW_DATA::ID => {
39059 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
39060 }
39061 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
39062 RC_CHANNELS_SCALED_DATA::random(rng),
39063 )),
39064 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
39065 REQUEST_DATA_STREAM_DATA::random(rng),
39066 )),
39067 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
39068 RESOURCE_REQUEST_DATA::ID => {
39069 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
39070 }
39071 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
39072 RESPONSE_EVENT_ERROR_DATA::random(rng),
39073 )),
39074 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
39075 SAFETY_ALLOWED_AREA_DATA::random(rng),
39076 )),
39077 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
39078 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
39079 )),
39080 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
39081 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
39082 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
39083 SCALED_PRESSURE_DATA::ID => {
39084 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
39085 }
39086 SCALED_PRESSURE2_DATA::ID => {
39087 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
39088 }
39089 SCALED_PRESSURE3_DATA::ID => {
39090 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
39091 }
39092 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
39093 SERIAL_UDB_EXTRA_F13_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F13(
39094 SERIAL_UDB_EXTRA_F13_DATA::random(rng),
39095 )),
39096 SERIAL_UDB_EXTRA_F14_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F14(
39097 SERIAL_UDB_EXTRA_F14_DATA::random(rng),
39098 )),
39099 SERIAL_UDB_EXTRA_F15_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F15(
39100 SERIAL_UDB_EXTRA_F15_DATA::random(rng),
39101 )),
39102 SERIAL_UDB_EXTRA_F16_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F16(
39103 SERIAL_UDB_EXTRA_F16_DATA::random(rng),
39104 )),
39105 SERIAL_UDB_EXTRA_F17_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F17(
39106 SERIAL_UDB_EXTRA_F17_DATA::random(rng),
39107 )),
39108 SERIAL_UDB_EXTRA_F18_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F18(
39109 SERIAL_UDB_EXTRA_F18_DATA::random(rng),
39110 )),
39111 SERIAL_UDB_EXTRA_F19_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F19(
39112 SERIAL_UDB_EXTRA_F19_DATA::random(rng),
39113 )),
39114 SERIAL_UDB_EXTRA_F20_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F20(
39115 SERIAL_UDB_EXTRA_F20_DATA::random(rng),
39116 )),
39117 SERIAL_UDB_EXTRA_F21_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F21(
39118 SERIAL_UDB_EXTRA_F21_DATA::random(rng),
39119 )),
39120 SERIAL_UDB_EXTRA_F22_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F22(
39121 SERIAL_UDB_EXTRA_F22_DATA::random(rng),
39122 )),
39123 SERIAL_UDB_EXTRA_F2_A_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F2_A(
39124 SERIAL_UDB_EXTRA_F2_A_DATA::random(rng),
39125 )),
39126 SERIAL_UDB_EXTRA_F2_B_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F2_B(
39127 SERIAL_UDB_EXTRA_F2_B_DATA::random(rng),
39128 )),
39129 SERIAL_UDB_EXTRA_F4_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F4(
39130 SERIAL_UDB_EXTRA_F4_DATA::random(rng),
39131 )),
39132 SERIAL_UDB_EXTRA_F5_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F5(
39133 SERIAL_UDB_EXTRA_F5_DATA::random(rng),
39134 )),
39135 SERIAL_UDB_EXTRA_F6_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F6(
39136 SERIAL_UDB_EXTRA_F6_DATA::random(rng),
39137 )),
39138 SERIAL_UDB_EXTRA_F7_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F7(
39139 SERIAL_UDB_EXTRA_F7_DATA::random(rng),
39140 )),
39141 SERIAL_UDB_EXTRA_F8_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F8(
39142 SERIAL_UDB_EXTRA_F8_DATA::random(rng),
39143 )),
39144 SERVO_OUTPUT_RAW_DATA::ID => {
39145 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
39146 }
39147 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
39148 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
39149 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
39150 )),
39151 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
39152 SET_ATTITUDE_TARGET_DATA::random(rng),
39153 )),
39154 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
39155 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
39156 )),
39157 SET_HOME_POSITION_DATA::ID => {
39158 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
39159 }
39160 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
39161 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
39162 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
39163 )),
39164 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
39165 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
39166 )),
39167 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
39168 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
39169 SMART_BATTERY_INFO_DATA::random(rng),
39170 )),
39171 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
39172 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
39173 STORAGE_INFORMATION_DATA::random(rng),
39174 )),
39175 SUPPORTED_TUNES_DATA::ID => {
39176 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
39177 }
39178 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
39179 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
39180 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
39181 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
39182 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
39183 TERRAIN_REQUEST_DATA::ID => {
39184 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
39185 }
39186 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
39187 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
39188 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
39189 )),
39190 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
39191 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
39192 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
39193 ))
39194 }
39195 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
39196 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
39197 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
39198 ))
39199 }
39200 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
39201 UAVCAN_NODE_INFO_DATA::ID => {
39202 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
39203 }
39204 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
39205 UAVCAN_NODE_STATUS_DATA::random(rng),
39206 )),
39207 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
39208 UTM_GLOBAL_POSITION_DATA::random(rng),
39209 )),
39210 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
39211 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
39212 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
39213 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
39214 VICON_POSITION_ESTIMATE_DATA::random(rng),
39215 )),
39216 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
39217 VIDEO_STREAM_INFORMATION_DATA::random(rng),
39218 )),
39219 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
39220 VIDEO_STREAM_STATUS_DATA::random(rng),
39221 )),
39222 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
39223 VISION_POSITION_ESTIMATE_DATA::random(rng),
39224 )),
39225 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
39226 VISION_SPEED_ESTIMATE_DATA::random(rng),
39227 )),
39228 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
39229 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
39230 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
39231 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
39232 _ => None,
39233 }
39234 }
39235 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
39236 match self {
39237 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
39238 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
39239 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
39240 Self::AIRSPEEDS(body) => body.ser(version, bytes),
39241 Self::AIS_VESSEL(body) => body.ser(version, bytes),
39242 Self::ALTITUDE(body) => body.ser(version, bytes),
39243 Self::ALTITUDES(body) => body.ser(version, bytes),
39244 Self::ATTITUDE(body) => body.ser(version, bytes),
39245 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
39246 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
39247 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
39248 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
39249 Self::AUTH_KEY(body) => body.ser(version, bytes),
39250 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
39251 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
39252 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
39253 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
39254 Self::BATTERY_INFO(body) => body.ser(version, bytes),
39255 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
39256 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
39257 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
39258 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
39259 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
39260 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
39261 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
39262 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
39263 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
39264 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
39265 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
39266 Self::CANFD_FRAME(body) => body.ser(version, bytes),
39267 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
39268 Self::CAN_FRAME(body) => body.ser(version, bytes),
39269 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
39270 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
39271 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
39272 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
39273 Self::COLLISION(body) => body.ser(version, bytes),
39274 Self::COMMAND_ACK(body) => body.ser(version, bytes),
39275 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
39276 Self::COMMAND_INT(body) => body.ser(version, bytes),
39277 Self::COMMAND_LONG(body) => body.ser(version, bytes),
39278 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
39279 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
39280 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
39281 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
39282 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
39283 Self::CURRENT_MODE(body) => body.ser(version, bytes),
39284 Self::DATA_STREAM(body) => body.ser(version, bytes),
39285 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
39286 Self::DEBUG(body) => body.ser(version, bytes),
39287 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
39288 Self::DEBUG_VECT(body) => body.ser(version, bytes),
39289 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
39290 Self::EFI_STATUS(body) => body.ser(version, bytes),
39291 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
39292 Self::ESC_INFO(body) => body.ser(version, bytes),
39293 Self::ESC_STATUS(body) => body.ser(version, bytes),
39294 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
39295 Self::EVENT(body) => body.ser(version, bytes),
39296 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
39297 Self::FENCE_STATUS(body) => body.ser(version, bytes),
39298 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
39299 Self::FLEXIFUNCTION_BUFFER_FUNCTION(body) => body.ser(version, bytes),
39300 Self::FLEXIFUNCTION_BUFFER_FUNCTION_ACK(body) => body.ser(version, bytes),
39301 Self::FLEXIFUNCTION_COMMAND(body) => body.ser(version, bytes),
39302 Self::FLEXIFUNCTION_COMMAND_ACK(body) => body.ser(version, bytes),
39303 Self::FLEXIFUNCTION_DIRECTORY(body) => body.ser(version, bytes),
39304 Self::FLEXIFUNCTION_DIRECTORY_ACK(body) => body.ser(version, bytes),
39305 Self::FLEXIFUNCTION_READ_REQ(body) => body.ser(version, bytes),
39306 Self::FLEXIFUNCTION_SET(body) => body.ser(version, bytes),
39307 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
39308 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
39309 Self::FUEL_STATUS(body) => body.ser(version, bytes),
39310 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
39311 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
39312 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
39313 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
39314 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
39315 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
39316 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
39317 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
39318 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
39319 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
39320 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
39321 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
39322 Self::GPS2_RAW(body) => body.ser(version, bytes),
39323 Self::GPS2_RTK(body) => body.ser(version, bytes),
39324 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
39325 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
39326 Self::GPS_INPUT(body) => body.ser(version, bytes),
39327 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
39328 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
39329 Self::GPS_RTK(body) => body.ser(version, bytes),
39330 Self::GPS_STATUS(body) => body.ser(version, bytes),
39331 Self::HEARTBEAT(body) => body.ser(version, bytes),
39332 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
39333 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
39334 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
39335 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
39336 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
39337 Self::HIL_GPS(body) => body.ser(version, bytes),
39338 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
39339 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
39340 Self::HIL_SENSOR(body) => body.ser(version, bytes),
39341 Self::HIL_STATE(body) => body.ser(version, bytes),
39342 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
39343 Self::HOME_POSITION(body) => body.ser(version, bytes),
39344 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
39345 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
39346 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
39347 Self::LANDING_TARGET(body) => body.ser(version, bytes),
39348 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
39349 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
39350 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
39351 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
39352 Self::LOGGING_ACK(body) => body.ser(version, bytes),
39353 Self::LOGGING_DATA(body) => body.ser(version, bytes),
39354 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
39355 Self::LOG_DATA(body) => body.ser(version, bytes),
39356 Self::LOG_ENTRY(body) => body.ser(version, bytes),
39357 Self::LOG_ERASE(body) => body.ser(version, bytes),
39358 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
39359 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
39360 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
39361 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
39362 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
39363 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
39364 Self::MEMORY_VECT(body) => body.ser(version, bytes),
39365 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
39366 Self::MISSION_ACK(body) => body.ser(version, bytes),
39367 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
39368 Self::MISSION_COUNT(body) => body.ser(version, bytes),
39369 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
39370 Self::MISSION_ITEM(body) => body.ser(version, bytes),
39371 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
39372 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
39373 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
39374 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
39375 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
39376 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
39377 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
39378 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
39379 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
39380 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
39381 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
39382 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
39383 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
39384 Self::ODOMETRY(body) => body.ser(version, bytes),
39385 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
39386 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
39387 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
39388 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
39389 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
39390 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
39391 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
39392 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
39393 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
39394 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
39395 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
39396 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
39397 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
39398 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
39399 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
39400 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
39401 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
39402 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
39403 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
39404 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
39405 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
39406 Self::PARAM_SET(body) => body.ser(version, bytes),
39407 Self::PARAM_VALUE(body) => body.ser(version, bytes),
39408 Self::PING(body) => body.ser(version, bytes),
39409 Self::PLAY_TUNE(body) => body.ser(version, bytes),
39410 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
39411 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
39412 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
39413 Self::POWER_STATUS(body) => body.ser(version, bytes),
39414 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
39415 Self::RADIO_STATUS(body) => body.ser(version, bytes),
39416 Self::RAW_IMU(body) => body.ser(version, bytes),
39417 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
39418 Self::RAW_RPM(body) => body.ser(version, bytes),
39419 Self::RC_CHANNELS(body) => body.ser(version, bytes),
39420 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
39421 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
39422 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
39423 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
39424 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
39425 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
39426 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
39427 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
39428 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
39429 Self::SCALED_IMU(body) => body.ser(version, bytes),
39430 Self::SCALED_IMU2(body) => body.ser(version, bytes),
39431 Self::SCALED_IMU3(body) => body.ser(version, bytes),
39432 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
39433 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
39434 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
39435 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
39436 Self::SERIAL_UDB_EXTRA_F13(body) => body.ser(version, bytes),
39437 Self::SERIAL_UDB_EXTRA_F14(body) => body.ser(version, bytes),
39438 Self::SERIAL_UDB_EXTRA_F15(body) => body.ser(version, bytes),
39439 Self::SERIAL_UDB_EXTRA_F16(body) => body.ser(version, bytes),
39440 Self::SERIAL_UDB_EXTRA_F17(body) => body.ser(version, bytes),
39441 Self::SERIAL_UDB_EXTRA_F18(body) => body.ser(version, bytes),
39442 Self::SERIAL_UDB_EXTRA_F19(body) => body.ser(version, bytes),
39443 Self::SERIAL_UDB_EXTRA_F20(body) => body.ser(version, bytes),
39444 Self::SERIAL_UDB_EXTRA_F21(body) => body.ser(version, bytes),
39445 Self::SERIAL_UDB_EXTRA_F22(body) => body.ser(version, bytes),
39446 Self::SERIAL_UDB_EXTRA_F2_A(body) => body.ser(version, bytes),
39447 Self::SERIAL_UDB_EXTRA_F2_B(body) => body.ser(version, bytes),
39448 Self::SERIAL_UDB_EXTRA_F4(body) => body.ser(version, bytes),
39449 Self::SERIAL_UDB_EXTRA_F5(body) => body.ser(version, bytes),
39450 Self::SERIAL_UDB_EXTRA_F6(body) => body.ser(version, bytes),
39451 Self::SERIAL_UDB_EXTRA_F7(body) => body.ser(version, bytes),
39452 Self::SERIAL_UDB_EXTRA_F8(body) => body.ser(version, bytes),
39453 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
39454 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
39455 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
39456 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
39457 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
39458 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
39459 Self::SET_MODE(body) => body.ser(version, bytes),
39460 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
39461 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
39462 Self::SIM_STATE(body) => body.ser(version, bytes),
39463 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
39464 Self::STATUSTEXT(body) => body.ser(version, bytes),
39465 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
39466 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
39467 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
39468 Self::SYS_STATUS(body) => body.ser(version, bytes),
39469 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
39470 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
39471 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
39472 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
39473 Self::TIMESYNC(body) => body.ser(version, bytes),
39474 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
39475 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
39476 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
39477 Self::TUNNEL(body) => body.ser(version, bytes),
39478 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
39479 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
39480 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
39481 Self::V2_EXTENSION(body) => body.ser(version, bytes),
39482 Self::VFR_HUD(body) => body.ser(version, bytes),
39483 Self::VIBRATION(body) => body.ser(version, bytes),
39484 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
39485 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
39486 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
39487 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
39488 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
39489 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
39490 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
39491 Self::WINCH_STATUS(body) => body.ser(version, bytes),
39492 Self::WIND_COV(body) => body.ser(version, bytes),
39493 }
39494 }
39495 fn extra_crc(id: u32) -> u8 {
39496 match id {
39497 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
39498 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
39499 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
39500 AIRSPEEDS_DATA::ID => AIRSPEEDS_DATA::EXTRA_CRC,
39501 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
39502 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
39503 ALTITUDES_DATA::ID => ALTITUDES_DATA::EXTRA_CRC,
39504 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
39505 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
39506 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
39507 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
39508 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
39509 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
39510 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
39511 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
39512 }
39513 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
39514 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
39515 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
39516 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
39517 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
39518 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
39519 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
39520 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
39521 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
39522 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
39523 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
39524 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
39525 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
39526 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
39527 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
39528 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
39529 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
39530 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
39531 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
39532 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
39533 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
39534 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
39535 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
39536 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
39537 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
39538 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
39539 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
39540 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
39541 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
39542 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
39543 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
39544 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
39545 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
39546 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
39547 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
39548 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
39549 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
39550 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
39551 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
39552 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
39553 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
39554 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
39555 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
39556 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
39557 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
39558 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
39559 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
39560 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
39561 FLEXIFUNCTION_BUFFER_FUNCTION_DATA::ID => FLEXIFUNCTION_BUFFER_FUNCTION_DATA::EXTRA_CRC,
39562 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::ID => {
39563 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::EXTRA_CRC
39564 }
39565 FLEXIFUNCTION_COMMAND_DATA::ID => FLEXIFUNCTION_COMMAND_DATA::EXTRA_CRC,
39566 FLEXIFUNCTION_COMMAND_ACK_DATA::ID => FLEXIFUNCTION_COMMAND_ACK_DATA::EXTRA_CRC,
39567 FLEXIFUNCTION_DIRECTORY_DATA::ID => FLEXIFUNCTION_DIRECTORY_DATA::EXTRA_CRC,
39568 FLEXIFUNCTION_DIRECTORY_ACK_DATA::ID => FLEXIFUNCTION_DIRECTORY_ACK_DATA::EXTRA_CRC,
39569 FLEXIFUNCTION_READ_REQ_DATA::ID => FLEXIFUNCTION_READ_REQ_DATA::EXTRA_CRC,
39570 FLEXIFUNCTION_SET_DATA::ID => FLEXIFUNCTION_SET_DATA::EXTRA_CRC,
39571 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
39572 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
39573 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
39574 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
39575 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
39576 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
39577 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
39578 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
39579 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
39580 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
39581 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
39582 }
39583 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
39584 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
39585 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
39586 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
39587 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
39588 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
39589 }
39590 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
39591 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
39592 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
39593 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
39594 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
39595 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
39596 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
39597 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
39598 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
39599 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
39600 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
39601 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
39602 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
39603 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
39604 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
39605 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
39606 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
39607 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
39608 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
39609 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
39610 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
39611 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
39612 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
39613 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
39614 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
39615 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
39616 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
39617 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
39618 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
39619 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
39620 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
39621 }
39622 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
39623 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
39624 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
39625 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
39626 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
39627 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
39628 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
39629 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
39630 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
39631 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
39632 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
39633 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
39634 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
39635 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
39636 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
39637 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
39638 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
39639 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
39640 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
39641 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
39642 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
39643 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
39644 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
39645 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
39646 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
39647 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
39648 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
39649 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
39650 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
39651 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
39652 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
39653 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
39654 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
39655 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
39656 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
39657 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
39658 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
39659 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
39660 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
39661 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
39662 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
39663 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
39664 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
39665 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
39666 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
39667 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
39668 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
39669 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
39670 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
39671 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
39672 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
39673 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
39674 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
39675 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
39676 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
39677 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
39678 PING_DATA::ID => PING_DATA::EXTRA_CRC,
39679 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
39680 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
39681 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
39682 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
39683 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
39684 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
39685 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
39686 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
39687 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
39688 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
39689 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
39690 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
39691 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
39692 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
39693 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
39694 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
39695 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
39696 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
39697 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
39698 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
39699 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
39700 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
39701 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
39702 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
39703 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
39704 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
39705 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
39706 SERIAL_UDB_EXTRA_F13_DATA::ID => SERIAL_UDB_EXTRA_F13_DATA::EXTRA_CRC,
39707 SERIAL_UDB_EXTRA_F14_DATA::ID => SERIAL_UDB_EXTRA_F14_DATA::EXTRA_CRC,
39708 SERIAL_UDB_EXTRA_F15_DATA::ID => SERIAL_UDB_EXTRA_F15_DATA::EXTRA_CRC,
39709 SERIAL_UDB_EXTRA_F16_DATA::ID => SERIAL_UDB_EXTRA_F16_DATA::EXTRA_CRC,
39710 SERIAL_UDB_EXTRA_F17_DATA::ID => SERIAL_UDB_EXTRA_F17_DATA::EXTRA_CRC,
39711 SERIAL_UDB_EXTRA_F18_DATA::ID => SERIAL_UDB_EXTRA_F18_DATA::EXTRA_CRC,
39712 SERIAL_UDB_EXTRA_F19_DATA::ID => SERIAL_UDB_EXTRA_F19_DATA::EXTRA_CRC,
39713 SERIAL_UDB_EXTRA_F20_DATA::ID => SERIAL_UDB_EXTRA_F20_DATA::EXTRA_CRC,
39714 SERIAL_UDB_EXTRA_F21_DATA::ID => SERIAL_UDB_EXTRA_F21_DATA::EXTRA_CRC,
39715 SERIAL_UDB_EXTRA_F22_DATA::ID => SERIAL_UDB_EXTRA_F22_DATA::EXTRA_CRC,
39716 SERIAL_UDB_EXTRA_F2_A_DATA::ID => SERIAL_UDB_EXTRA_F2_A_DATA::EXTRA_CRC,
39717 SERIAL_UDB_EXTRA_F2_B_DATA::ID => SERIAL_UDB_EXTRA_F2_B_DATA::EXTRA_CRC,
39718 SERIAL_UDB_EXTRA_F4_DATA::ID => SERIAL_UDB_EXTRA_F4_DATA::EXTRA_CRC,
39719 SERIAL_UDB_EXTRA_F5_DATA::ID => SERIAL_UDB_EXTRA_F5_DATA::EXTRA_CRC,
39720 SERIAL_UDB_EXTRA_F6_DATA::ID => SERIAL_UDB_EXTRA_F6_DATA::EXTRA_CRC,
39721 SERIAL_UDB_EXTRA_F7_DATA::ID => SERIAL_UDB_EXTRA_F7_DATA::EXTRA_CRC,
39722 SERIAL_UDB_EXTRA_F8_DATA::ID => SERIAL_UDB_EXTRA_F8_DATA::EXTRA_CRC,
39723 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
39724 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
39725 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
39726 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
39727 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
39728 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
39729 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
39730 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
39731 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
39732 }
39733 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
39734 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
39735 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
39736 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
39737 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
39738 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
39739 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
39740 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
39741 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
39742 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
39743 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
39744 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
39745 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
39746 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
39747 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
39748 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
39749 }
39750 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
39751 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
39752 }
39753 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
39754 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
39755 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
39756 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
39757 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
39758 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
39759 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
39760 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
39761 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
39762 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
39763 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
39764 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
39765 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
39766 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
39767 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
39768 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
39769 _ => 0,
39770 }
39771 }
39772 fn target_system_id(&self) -> Option<u8> {
39773 match self {
39774 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
39775 Self::CANFD_FRAME(inner) => Some(inner.target_system),
39776 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
39777 Self::CAN_FRAME(inner) => Some(inner.target_system),
39778 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
39779 Self::COMMAND_ACK(inner) => Some(inner.target_system),
39780 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
39781 Self::COMMAND_INT(inner) => Some(inner.target_system),
39782 Self::COMMAND_LONG(inner) => Some(inner.target_system),
39783 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
39784 Self::FLEXIFUNCTION_BUFFER_FUNCTION(inner) => Some(inner.target_system),
39785 Self::FLEXIFUNCTION_BUFFER_FUNCTION_ACK(inner) => Some(inner.target_system),
39786 Self::FLEXIFUNCTION_COMMAND(inner) => Some(inner.target_system),
39787 Self::FLEXIFUNCTION_DIRECTORY(inner) => Some(inner.target_system),
39788 Self::FLEXIFUNCTION_DIRECTORY_ACK(inner) => Some(inner.target_system),
39789 Self::FLEXIFUNCTION_READ_REQ(inner) => Some(inner.target_system),
39790 Self::FLEXIFUNCTION_SET(inner) => Some(inner.target_system),
39791 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
39792 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
39793 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
39794 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
39795 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
39796 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
39797 Self::LOGGING_ACK(inner) => Some(inner.target_system),
39798 Self::LOGGING_DATA(inner) => Some(inner.target_system),
39799 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
39800 Self::LOG_ERASE(inner) => Some(inner.target_system),
39801 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
39802 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
39803 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
39804 Self::MISSION_ACK(inner) => Some(inner.target_system),
39805 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
39806 Self::MISSION_COUNT(inner) => Some(inner.target_system),
39807 Self::MISSION_ITEM(inner) => Some(inner.target_system),
39808 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
39809 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
39810 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
39811 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
39812 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
39813 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
39814 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
39815 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
39816 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
39817 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
39818 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
39819 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
39820 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
39821 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
39822 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
39823 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
39824 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
39825 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
39826 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
39827 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
39828 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
39829 Self::PARAM_SET(inner) => Some(inner.target_system),
39830 Self::PING(inner) => Some(inner.target_system),
39831 Self::PLAY_TUNE(inner) => Some(inner.target_system),
39832 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
39833 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
39834 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
39835 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
39836 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
39837 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
39838 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
39839 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
39840 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
39841 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
39842 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
39843 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
39844 Self::SET_MODE(inner) => Some(inner.target_system),
39845 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
39846 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
39847 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
39848 Self::TIMESYNC(inner) => Some(inner.target_system),
39849 Self::TUNNEL(inner) => Some(inner.target_system),
39850 Self::V2_EXTENSION(inner) => Some(inner.target_system),
39851 _ => None,
39852 }
39853 }
39854 fn target_component_id(&self) -> Option<u8> {
39855 match self {
39856 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
39857 Self::CANFD_FRAME(inner) => Some(inner.target_component),
39858 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
39859 Self::CAN_FRAME(inner) => Some(inner.target_component),
39860 Self::COMMAND_ACK(inner) => Some(inner.target_component),
39861 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
39862 Self::COMMAND_INT(inner) => Some(inner.target_component),
39863 Self::COMMAND_LONG(inner) => Some(inner.target_component),
39864 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
39865 Self::FLEXIFUNCTION_BUFFER_FUNCTION(inner) => Some(inner.target_component),
39866 Self::FLEXIFUNCTION_BUFFER_FUNCTION_ACK(inner) => Some(inner.target_component),
39867 Self::FLEXIFUNCTION_COMMAND(inner) => Some(inner.target_component),
39868 Self::FLEXIFUNCTION_DIRECTORY(inner) => Some(inner.target_component),
39869 Self::FLEXIFUNCTION_DIRECTORY_ACK(inner) => Some(inner.target_component),
39870 Self::FLEXIFUNCTION_READ_REQ(inner) => Some(inner.target_component),
39871 Self::FLEXIFUNCTION_SET(inner) => Some(inner.target_component),
39872 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
39873 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
39874 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
39875 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
39876 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
39877 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
39878 Self::LOGGING_ACK(inner) => Some(inner.target_component),
39879 Self::LOGGING_DATA(inner) => Some(inner.target_component),
39880 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
39881 Self::LOG_ERASE(inner) => Some(inner.target_component),
39882 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
39883 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
39884 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
39885 Self::MISSION_ACK(inner) => Some(inner.target_component),
39886 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
39887 Self::MISSION_COUNT(inner) => Some(inner.target_component),
39888 Self::MISSION_ITEM(inner) => Some(inner.target_component),
39889 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
39890 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
39891 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
39892 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
39893 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
39894 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
39895 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
39896 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
39897 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
39898 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
39899 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
39900 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
39901 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
39902 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
39903 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
39904 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
39905 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
39906 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
39907 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
39908 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
39909 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
39910 Self::PARAM_SET(inner) => Some(inner.target_component),
39911 Self::PING(inner) => Some(inner.target_component),
39912 Self::PLAY_TUNE(inner) => Some(inner.target_component),
39913 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
39914 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
39915 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
39916 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
39917 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
39918 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
39919 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
39920 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
39921 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
39922 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
39923 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
39924 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
39925 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
39926 Self::TIMESYNC(inner) => Some(inner.target_component),
39927 Self::TUNNEL(inner) => Some(inner.target_component),
39928 Self::V2_EXTENSION(inner) => Some(inner.target_component),
39929 _ => None,
39930 }
39931 }
39932}